Skip to content

Commit a630e03

Browse files
Merge pull request #1847 from caberos/issue1844
unexpected error when using vlan list with --limit 0 or 999 and a lar…
2 parents 917cce5 + ef21f48 commit a630e03

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

SoftLayer/CLI/vlan/list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def cli(env, sortby, datacenter, number, name, limit):
6565
vlan.get('vlanNumber'),
6666
vlan.get('fullyQualifiedName'),
6767
vlan.get('name') or formatting.blank(),
68-
vlan.get('networkSpace').capitalize(),
68+
vlan.get('networkSpace', 'Direct Link').capitalize(),
6969
utils.lookup(vlan, 'primaryRouter', 'datacenter', 'name'),
7070
get_pod_with_closed_announcement(vlan, pods),
7171
get_gateway_firewall(vlan),

SoftLayer/fixtures/SoftLayer_Account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485

486486
getNetworkVlans = [{
487487
'id': 1,
488-
'networkSpace': 'PRIVATE',
488+
'networkSpace': '',
489489
'hardwareCount': 0,
490490
'hardware': [],
491491
'vlanNumber': 12,

tests/CLI/modules/vlan_tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ def test_vlan_list(self):
143143
self.assert_no_fail(result)
144144
self.assert_called_with('SoftLayer_Account', 'getNetworkVlans')
145145

146+
def test_vlan_list_space_empty(self):
147+
result = self.run_command(['vlan', 'list'])
148+
self.assert_no_fail(result)
149+
self.assert_called_with('SoftLayer_Account', 'getNetworkVlans')
150+
self.assertEqual(json.loads(result.output)[0]['Network'], '')
151+
146152
def test_create_vlan(self):
147153
_mock = self.set_mock('SoftLayer_Product_Package', 'getItems')
148154
_mock.return_value = SoftLayer_Product_Package.getItemsVLAN

0 commit comments

Comments
 (0)