Skip to content

Commit 6e149fa

Browse files
committed
Removes string conversion from loop
1 parent e9c2d1f commit 6e149fa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

SoftLayer/managers/network.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ def add_subnet(self, subnet_type, quantity=None, vlan_id=None, version=4,
6767
# looking for the items we need based upon the category, quantity, and
6868
# item description.
6969
price_id = None
70+
quantity_str = str(quantity)
7071
for item in package.getItems(id=0, mask='itemCategory'):
7172
category_code = lookup(item, 'itemCategory', 'categoryCode')
7273
if all([category_code == category,
73-
item.get('capacity') == str(quantity),
74+
item.get('capacity') == quantity_str,
7475
version == 4 or (version == 6 and
7576
desc in item['description'])]):
7677
price_id = item['prices'][0]['id']

0 commit comments

Comments
 (0)