From 65827f1aa67d19f1c9e91026c38c355bc5720678 Mon Sep 17 00:00:00 2001 From: JUNJIE NAN Date: Wed, 28 Mar 2018 16:37:47 +0800 Subject: [PATCH] Fixed list index out of range error The error found when `locationGroupId` is None. --- SoftLayer/managers/ordering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoftLayer/managers/ordering.py b/SoftLayer/managers/ordering.py index 4d8e94c13..814568a18 100644 --- a/SoftLayer/managers/ordering.py +++ b/SoftLayer/managers/ordering.py @@ -341,7 +341,7 @@ def get_price_id_list(self, package_keyname, item_keynames): # can take that ID and create the proper price for us in the location # in which the order is made price_id = [p['id'] for p in matching_item['prices'] - if p['locationGroupId'] == ''][0] + if not p.get('locationGroupId')][0] prices.append(price_id) return prices