Skip to content

Commit 4331a92

Browse files
manager.hardware.place_order size can now be a presetID
1 parent a0fdc07 commit 4331a92

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

SoftLayer/managers/hardware.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,15 +748,13 @@ def _get_location(package, location):
748748
if region['location']['location']['name'] == location:
749749
return region
750750

751-
raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'"
752-
% location)
751+
raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'" % location)
753752

754753

755754
def _get_preset_id(package, size):
756755
"""Get the preset id given the keyName of the preset."""
757756
for preset in package['activePresets']:
758-
if preset['keyName'] == size:
757+
if preset['keyName'] == size or preset['id'] == size:
759758
return preset['id']
760759

761-
raise SoftLayer.SoftLayerError("Could not find valid size for: '%s'"
762-
% size)
760+
raise SoftLayer.SoftLayerError("Could not find valid size for: '%s'" % size)

0 commit comments

Comments
 (0)