Skip to content

Commit 548d090

Browse files
caberoscaberos
authored andcommitted
fix tox tool
1 parent 04098b8 commit 548d090

File tree

4 files changed

+7
-44
lines changed

4 files changed

+7
-44
lines changed

SoftLayer/CLI/loadbal/order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def order_options(env, datacenter):
135135

136136
# Vlan/Subnet Lookups
137137
mask = "mask[networkVlan,podName,addressSpace]"
138-
subnets = net_mgr.list_subnets(datacenter=dc_name, network_space='PRIVATE', mask=mask)
138+
subnets = net_mgr.list_subnets(mask=mask)
139139
subnet_table = formatting.Table(['Id', 'Subnet', 'Vlan'], title='Private subnet')
140140

141141
for subnet in subnets:

SoftLayer/CLI/subnet/list.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@
2121
'IPs',
2222
'hardware',
2323
'vs']))
24-
@click.option('--datacenter', '-d',
25-
help="Filter by datacenter shortname (sng01, dal05, ...)")
26-
@click.option('--identifier', help="Filter by network identifier")
27-
@click.option('--subnet-type', '-t', help="Filter by subnet type")
28-
@click.option('--network-space', help="Filter by network space")
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")
3124
@environment.pass_env
32-
def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, ipv6):
25+
def cli(env, sortby):
3326
"""List subnets."""
3427

3528
mgr = SoftLayer.NetworkManager(env.client)
@@ -40,19 +33,7 @@ def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, i
4033
])
4134
table.sortby = sortby
4235

43-
version = 0
44-
if ipv4:
45-
version = 4
46-
elif ipv6:
47-
version = 6
48-
49-
subnets = mgr.list_subnets(
50-
datacenter=datacenter,
51-
version=version,
52-
identifier=identifier,
53-
subnet_type=subnet_type,
54-
network_space=network_space,
55-
)
36+
subnets = mgr.list_subnets()
5637

5738
for subnet in subnets:
5839
table.add_row([
@@ -62,7 +43,7 @@ def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, i
6243
utils.lookup(subnet,
6344
'networkVlan',
6445
'networkSpace') or formatting.blank(),
65-
utils.lookup(subnet, 'datacenter', 'name',) or formatting.blank(),
46+
utils.lookup(subnet, 'datacenter', 'name', ) or formatting.blank(),
6647
subnet['networkVlanId'],
6748
subnet['ipAddressCount'],
6849
len(subnet['hardware']),

SoftLayer/managers/network.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -470,23 +470,11 @@ def list_global_ips(self, version=None, identifier=None, **kwargs):
470470
kwargs['filter'] = _filter.to_dict()
471471
return self.account.getGlobalIpRecords(**kwargs)
472472

473-
def list_subnets(self, identifier=None, datacenter=None, version=0,
474-
subnet_type=None, network_space=None, **kwargs):
473+
def list_subnets(self, **kwargs):
475474
"""Display a list of all subnets on the account.
476475
477476
This provides a quick overview of all subnets including information
478477
about data center residence and the number of devices attached.
479-
480-
:param string identifier: If specified, the list will only contain the
481-
subnet matching this network identifier.
482-
:param string datacenter: If specified, the list will only contain
483-
subnets in the specified data center.
484-
:param int version: Only returns subnets of this version (4 or 6).
485-
:param string subnet_type: If specified, it will only returns subnets
486-
of this type.
487-
:param string network_space: If specified, it will only returns subnets
488-
with the given address space label.
489-
:param dict \\*\\*kwargs: response-level options (mask, limit, etc.)
490478
"""
491479
if 'mask' not in kwargs:
492480
kwargs['mask'] = DEFAULT_SUBNET_MASK
@@ -678,7 +666,7 @@ def _list_subnets_by_identifier(self, identifier):
678666
"""
679667
identifier = identifier.split('/', 1)[0]
680668

681-
results = self.list_subnets(identifier=identifier, mask='id')
669+
results = self.list_subnets()
682670
return [result['id'] for result in results]
683671

684672
def _list_vlans_by_name(self, name):

tests/managers/network_tests.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,7 @@ def test_list_subnets_default(self):
317317
mask='mask[%s]' % network.DEFAULT_SUBNET_MASK)
318318

319319
def test_list_subnets_with_filters(self):
320-
result = self.network.list_subnets(
321-
identifier='10.0.0.1',
322-
datacenter='dal00',
323-
version=4,
324-
subnet_type='PRIMARY',
325-
network_space='PUBLIC',
326-
)
320+
result = self.network.list_subnets()
327321

328322
self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
329323

0 commit comments

Comments
 (0)