Merge pull request #27408 from rallytime/fix-27406-for-2015.5

Fix avail_locations function for the softlayer_hw driver in 2015.5
This commit is contained in:
Joseph Hall 2015-09-25 17:34:50 -06:00
commit 5dd1b70475
2 changed files with 11 additions and 10 deletions

View file

@ -230,8 +230,8 @@ Set up an initial profile at ``/etc/salt/cloud.profiles``:
image: 13963
# 2 x 2.0 GHz Core Bare Metal Instance - 2 GB Ram
size: 1921
# 250GB SATA II
hdd: 19
# 500GB SATA II
hdd: 1267
# San Jose 01
location: 168642
domain: example.com
@ -270,15 +270,14 @@ contain. The `id` will be the setting to be used in the profile.
hdd
---
There are currently two sizes of hard disk drive (HDD) that are available for
There is currently only one size of hard disk drive (HDD) that is available for
hardware instances on SoftLayer:
.. code-block:: yaml
19: 250GB SATA II
1267: 500GB SATA II
The `hdd` setting in the profile will be either 19 or 1267. Other sizes may be
The `hdd` setting in the profile should be 1267. Other sizes may be
added in the future.
location
@ -396,8 +395,8 @@ them, that can be passed into Salt Cloud with the `optional_products` option:
image: 13963
# 2 x 2.0 GHz Core Bare Metal Instance - 2 GB Ram
size: 1921
# 250GB SATA II
hdd: 19
# 500GB SATA II
hdd: 1267
# San Jose 01
location: 168642
domain: example.com

View file

@ -118,6 +118,8 @@ def avail_locations(call=None):
available = conn.getAvailableLocations(id=50)
for location in available:
if location.get('isAvailable', 0) is 0:
continue
ret[location['locationId']]['available'] = True
return ret
@ -443,7 +445,7 @@ def create(vm_):
}
optional_products = config.get_cloud_config_value(
'optional_products', vm_, __opts__, default=True
'optional_products', vm_, __opts__, default=[]
)
for product in optional_products:
kwargs['prices'].append({'id': product})
@ -454,9 +456,9 @@ def create(vm_):
)
kwargs['prices'].append({'id': port_speed})
# Default is 248 (5000 GB Bandwidth)
# Default is 1800 (0 GB Bandwidth)
bandwidth = config.get_cloud_config_value(
'bandwidth', vm_, __opts__, default=248
'bandwidth', vm_, __opts__, default=1800
)
kwargs['prices'].append({'id': bandwidth})