{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/27406","labels_url":"https://api.github.com/repos/saltstack/salt/issues/27406/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/27406/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/27406/events","html_url":"https://github.com/saltstack/salt/issues/27406","id":108358914,"number":27406,"title":"salt-cloud error with Softlayer (Bare Metal Instance): TypeError: 'bool' object is not iterable and with --list-locations: Failed to get the output of 'softlayer_hw.avail_locations()': 142776","user":{"login":"s-iraheta","id":9540131,"avatar_url":"https://avatars.githubusercontent.com/u/9540131?v=3","gravatar_id":"","url":"https://api.github.com/users/s-iraheta","html_url":"https://github.com/s-iraheta","followers_url":"https://api.github.com/users/s-iraheta/followers","following_url":"https://api.github.com/users/s-iraheta/following{/other_user}","gists_url":"https://api.github.com/users/s-iraheta/gists{/gist_id}","starred_url":"https://api.github.com/users/s-iraheta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-iraheta/subscriptions","organizations_url":"https://api.github.com/users/s-iraheta/orgs","repos_url":"https://api.github.com/users/s-iraheta/repos","events_url":"https://api.github.com/users/s-iraheta/events{/privacy}","received_events_url":"https://api.github.com/users/s-iraheta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-25T16:28:50Z","updated_at":"2015-09-25T16:41:53Z","closed_at":null,"body":"Hi.\r\nWhen I try to create a Softlayer bare metal instance, salt-cloud failed and show me this error when I execute the command `sudo salt-cloud -p logs instance`:\r\n\r\n```python\r\n[ERROR   ] There was a profile error: 'bool' object is not iterable\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/salt/cloud/cli.py\", line 254, in run\r\n    self.config.get('names')\r\n  File \"/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py\", line 1391, in run_profile\r\n    ret[name] = self.create(vm_)\r\n  File \"/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py\", line 1241, in create\r\n    output = self.clouds[func](vm_)\r\n  File \"/usr/lib/python2.7/dist-packages/salt/cloud/clouds/softlayer_hw.py\", line 448, in create\r\n    for product in optional_products:\r\nTypeError: 'bool' object is not iterable\r\n```\r\nThese are my config files:\r\n\r\n```bash\r\n$ sudo salt-cloud --version\r\nsalt-cloud 2015.5.3 (Lithium)\r\n```\r\n```bash\r\n$ sudo cat cloud.providers.d/softlayer.provider.conf \r\nsoftlayer:\r\n minion:\r\n  master: xx.yy.zz\r\n user: provision\r\n apikey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\r\n provider: softlayer\r\n\r\nsoftlayerHw:\r\n minion:\r\n  master: xx.yy.zz\r\n user: provision\r\n apikey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\r\n provider: softlayer_hw\r\n```\r\n```bash\r\n$ cat cloud.profiles.d/profiles.conf \r\nlogs:\r\n provider: softlayerHw\r\n image: 22251\r\n size: 2164\r\n hdd: 19\r\n domain: yy.zz\r\n location: 138124\r\n```\r\nThere is another weird behavior: When I executed `sudo salt-cloud --list-locations softlayerHw` I received this error message:\r\n\r\n```python\r\n[ERROR   ] Failed to get the output of 'softlayer_hw.avail_locations()': 142776\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py\", line 798, in location_list\r\n    data[alias][driver] = self.clouds[fun]()\r\n  File \"/usr/lib/python2.7/dist-packages/salt/cloud/clouds/softlayer_hw.py\", line 121, in avail_locations\r\n    ret[location['locationId']]['available'] = True\r\nKeyError: 142776\r\n[DEBUG   ] LazyLoaded nested.output\r\n```\r\nThe only way to know which ID have Dallas05 was execute `sudo salt-cloud --list-locations softlayer -l debug` and search into the XML output.\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/143273059","html_url":"https://github.com/saltstack/salt/issues/27406#issuecomment-143273059","issue_url":"https://api.github.com/repos/saltstack/salt/issues/27406","id":143273059,"user":{"login":"rallytime","id":6547906,"avatar_url":"https://avatars.githubusercontent.com/u/6547906?v=3","gravatar_id":"","url":"https://api.github.com/users/rallytime","html_url":"https://github.com/rallytime","followers_url":"https://api.github.com/users/rallytime/followers","following_url":"https://api.github.com/users/rallytime/following{/other_user}","gists_url":"https://api.github.com/users/rallytime/gists{/gist_id}","starred_url":"https://api.github.com/users/rallytime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rallytime/subscriptions","organizations_url":"https://api.github.com/users/rallytime/orgs","repos_url":"https://api.github.com/users/rallytime/repos","events_url":"https://api.github.com/users/rallytime/events{/privacy}","received_events_url":"https://api.github.com/users/rallytime/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T16:41:53Z","updated_at":"2015-09-25T16:41:53Z","body":"@s-iraheta Or, if not, the fix is simple if you feel comfortable. In the path to your salt install, in `salt/cloud/clouds/softlayer_hw.py` add the following lines to the `avail_locations` function (around line 121):\r\n```\r\nif location.get('isAvailable', 0) is 0:\r\n    continue\r\n```\r\nSo that the whole function looks like [this](https://github.com/saltstack/salt/blob/b72e0b113339a6addcdc2c5c4ea82f38c38a0104/salt/cloud/clouds/softlayer_hw.py#L117)."}}