Skip to content

Commit e807325

Browse files
committed
Merge with master
2 parents c10b3c5 + bdb57e8 commit e807325

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

SoftLayer/CLI/subnet/detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def cli(env, identifier, no_vs, no_hardware):
3838
table.add_row(['identifier',
3939
'%s/%s' % (subnet['networkIdentifier'],
4040
str(subnet['cidr']))])
41-
table.add_row(['subnet type', subnet['subnetType']])
41+
table.add_row(['subnet type', subnet.get('subnetType', formatting.blank())])
4242
table.add_row(['network space',
4343
utils.lookup(subnet, 'networkVlan', 'networkSpace')])
4444
table.add_row(['gateway', subnet.get('gateway', formatting.blank())])

SoftLayer/managers/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def _list_subnets_by_identifier(self, identifier):
698698
"""
699699
identifier = identifier.split('/', 1)[0]
700700

701-
results = self.list_subnets(identifier=identifier, mask='id')
701+
results = self.list_subnets()
702702
return [result['id'] for result in results]
703703

704704
def _list_vlans_by_name(self, name):

tests/CLI/modules/account_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ def test_invoice_detail_csv_output_format(self):
7171
result_output = result.output.replace('\r', '').split('\n')
7272
self.assert_no_fail(result)
7373
self.assertEqual(result_output[0], 'Item Id,Category,Description,Single,Monthly,Create Date,Location')
74-
self.assertEqual(result_output[1], '724951323,Private (only) Secondary VLAN IP Addresses,64 Portable Private'
75-
' IP Addresses (bleg.beh.com),$0.00,$0.00,2018-04-04,fra02')
74+
self.assertEqual(result_output[1], '724951323,Private (only) Secondary VLAN IP Addresses,'
75+
'64 Portable Private IP Addresses (bleg.beh.com),'
76+
'$0.00,$0.00,2018-04-04,fra02')
7677

7778
# slcli account invoices
7879
def test_invoices(self):

tests/managers/network_tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,13 @@ def test_list_global_ips_with_filter(self):
310310
filter=_filter)
311311

312312
def test_list_subnets_default(self):
313-
result = self.network.list_subnets()
314-
315-
self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
316-
self.assert_called_with('SoftLayer_Account', 'getSubnets',
317-
mask='mask[%s]' % network.DEFAULT_SUBNET_MASK)
318-
319-
def test_list_subnets_with_filters(self):
320313
result = self.network.list_subnets(
321314
identifier='10.0.0.1',
322315
datacenter='dal00',
323316
version=4,
324317
subnet_type='PRIMARY',
325318
network_space='PUBLIC',
326319
)
327-
328320
self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
329321
_filter = {
330322
'subnets': {
@@ -342,6 +334,14 @@ def test_list_subnets_with_filters(self):
342334
mask='mask[%s]' % network.DEFAULT_SUBNET_MASK,
343335
filter=_filter)
344336

337+
def test_list_subnets_with_filters(self):
338+
result = self.network.list_subnets()
339+
340+
self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
341+
342+
self.assert_called_with('SoftLayer_Account', 'getSubnets',
343+
mask='mask[%s]' % network.DEFAULT_SUBNET_MASK)
344+
345345
def test_list_vlans_default(self):
346346
result = self.network.list_vlans()
347347

0 commit comments

Comments
 (0)