Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions SoftLayer/managers/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def get_create_options(self):
if item['itemCategory']['categoryCode'] == 'os':
operating_systems.append({
'name': item['softwareDescription']['longDescription'],
'key': item['softwareDescription']['referenceCode'],
'key': item['keyName']
})

# Port speeds
Expand Down Expand Up @@ -777,8 +777,7 @@ def _get_os_price_id(items, os, location):
'itemCategory',
'categoryCode') != 'os',
utils.lookup(item,
'softwareDescription',
'referenceCode') != os]):
'keyName') != os]):
continue

for price in item['prices']:
Expand Down
4 changes: 2 additions & 2 deletions tests/CLI/modules/server_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def test_create_options(self):
{'size': 'Dual Xeon Gold, 384GB Ram, 4x960GB SSD, RAID 10',
'value': 'DGOLD_6140_384GB_4X960GB_SSD_SED_RAID_10'}],
[{'operating_system': 'Ubuntu / 14.04-64',
'value': 'UBUNTU_14_64'}],
'value': 'OS_UBUNTU_14_04_LTS_TRUSTY_TAHR_64_BIT'}],
[{'port_speed': '10 Mbps Public & Private Network Uplinks',
'value': '10'}],
[{'extras': '1 IPv6 Address', 'value': '1_IPV6_ADDRESS'}]]
Expand All @@ -336,7 +336,7 @@ def test_create_server(self, order_mock):
'--domain=example.com',
'--datacenter=TEST00',
'--port-speed=100',
'--os=UBUNTU_12_64',
'--os=OS_UBUNTU_14_04_LTS_TRUSTY_TAHR_64_BIT',
'--no-public',
'--key=10',
])
Expand Down
12 changes: 6 additions & 6 deletions tests/managers/hardware_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_get_create_options(self):
expected = {
'extras': [{'key': '1_IPV6_ADDRESS', 'name': '1 IPv6 Address'}],
'locations': [{'key': 'wdc01', 'name': 'Washington 1'}],
'operating_systems': [{'key': 'UBUNTU_14_64',
'operating_systems': [{'key': 'OS_UBUNTU_14_04_LTS_TRUSTY_TAHR_64_BIT',
'name': 'Ubuntu / 14.04-64'}],
'port_speeds': [{
'key': '10',
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_generate_create_dict_invalid_size(self):
'hostname': 'unicorn',
'domain': 'giggles.woo',
'location': 'wdc01',
'os': 'UBUNTU_14_64',
'os': 'OS_UBUNTU_14_04_LTS_TRUSTY_TAHR_64_BIT',
'port_speed': 10,
}

Expand All @@ -194,7 +194,7 @@ def test_generate_create_dict(self):
'hostname': 'unicorn',
'domain': 'giggles.woo',
'location': 'wdc01',
'os': 'UBUNTU_14_64',
'os': 'OS_UBUNTU_14_04_LTS_TRUSTY_TAHR_64_BIT',
'port_speed': 10,
'hourly': True,
'extras': ['1_IPV6_ADDRESS'],
Expand Down Expand Up @@ -514,11 +514,11 @@ def test_get_bandwidth_price_mismatched(self):
def test_get_os_price_mismatched(self):
items = [
{'itemCategory': {'categoryCode': 'os'},
'softwareDescription': {'referenceCode': 'TEST_OS'},
'keyName': 'OS_TEST',
'prices': [{'id': 2, 'locationGroupId': 55, 'recurringFee': 99}]
},
{'itemCategory': {'categoryCode': 'os'},
'softwareDescription': {'referenceCode': 'TEST_OS'},
'keyName': 'OS_TEST',
'prices': [{'id': 3, 'locationGroupId': None, 'recurringFee': 99}]
},
]
Expand All @@ -532,7 +532,7 @@ def test_get_os_price_mismatched(self):
}
}
}
result = managers.hardware._get_os_price_id(items, 'TEST_OS', location)
result = managers.hardware._get_os_price_id(items, 'OS_TEST', location)
self.assertEqual(3, result)

def test_get_default_price_id_item_not_first(self):
Expand Down