Skip to content

Commit

Permalink
Merge pull request #1076 from allmightyspiff/1060
Browse files Browse the repository at this point in the history
#1060 - bug in subnet list
  • Loading branch information
allmightyspiff committed Nov 16, 2018
2 parents d6821f3 + 96eb1d8 commit 055860a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 3 additions & 4 deletions SoftLayer/CLI/subnet/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
@click.option('--identifier', help="Filter by network identifier")
@click.option('--subnet-type', '-t', help="Filter by subnet type")
@click.option('--network-space', help="Filter by network space")
@click.option('--v4', '--ipv4', is_flag=True, help="Display only IPv4 subnets")
@click.option('--v6', '--ipv6', is_flag=True, help="Display only IPv6 subnets")
@click.option('--ipv4', '--v4', is_flag=True, help="Display only IPv4 subnets")
@click.option('--ipv6', '--v6', is_flag=True, help="Display only IPv6 subnets")
@environment.pass_env
def cli(env, sortby, datacenter, identifier, subnet_type, network_space,
ipv4, ipv6):
def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, ipv6):
"""List subnets."""

mgr = SoftLayer.NetworkManager(env.client)
Expand Down
7 changes: 6 additions & 1 deletion SoftLayer/fixtures/SoftLayer_Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,14 @@
{
'id': '100',
'networkIdentifier': '10.0.0.1',
'cidr': '/24',
'networkVlanId': 123,
'datacenter': {'name': 'dal00'},
'version': 4,
'subnetType': 'PRIMARY'
'subnetType': 'PRIMARY',
'ipAddressCount': 10,
'virtualGuests': [],
'hardware': []
}]

getSshKeys = [{'id': '100', 'label': 'Test 1'},
Expand Down
4 changes: 4 additions & 0 deletions tests/CLI/modules/subnet_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ def test_detail(self):
'usable ips': 22
},
json.loads(result.output))

def test_list(self):
result = self.run_command(['subnet', 'list'])
self.assert_no_fail(result)

0 comments on commit 055860a

Please sign in to comment.