Skip to content

Commit 055860a

Browse files
Merge pull request #1076 from allmightyspiff/1060
#1060 - bug in subnet list
2 parents d6821f3 + 96eb1d8 commit 055860a

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

SoftLayer/CLI/subnet/list.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
@click.option('--identifier', help="Filter by network identifier")
2727
@click.option('--subnet-type', '-t', help="Filter by subnet type")
2828
@click.option('--network-space', help="Filter by network space")
29-
@click.option('--v4', '--ipv4', is_flag=True, help="Display only IPv4 subnets")
30-
@click.option('--v6', '--ipv6', is_flag=True, help="Display only IPv6 subnets")
29+
@click.option('--ipv4', '--v4', is_flag=True, help="Display only IPv4 subnets")
30+
@click.option('--ipv6', '--v6', is_flag=True, help="Display only IPv6 subnets")
3131
@environment.pass_env
32-
def cli(env, sortby, datacenter, identifier, subnet_type, network_space,
33-
ipv4, ipv6):
32+
def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, ipv6):
3433
"""List subnets."""
3534

3635
mgr = SoftLayer.NetworkManager(env.client)

SoftLayer/fixtures/SoftLayer_Account.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,14 @@
316316
{
317317
'id': '100',
318318
'networkIdentifier': '10.0.0.1',
319+
'cidr': '/24',
320+
'networkVlanId': 123,
319321
'datacenter': {'name': 'dal00'},
320322
'version': 4,
321-
'subnetType': 'PRIMARY'
323+
'subnetType': 'PRIMARY',
324+
'ipAddressCount': 10,
325+
'virtualGuests': [],
326+
'hardware': []
322327
}]
323328

324329
getSshKeys = [{'id': '100', 'label': 'Test 1'},

tests/CLI/modules/subnet_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ def test_detail(self):
3535
'usable ips': 22
3636
},
3737
json.loads(result.output))
38+
39+
def test_list(self):
40+
result = self.run_command(['subnet', 'list'])
41+
self.assert_no_fail(result)

0 commit comments

Comments
 (0)