network: Address nits for I3c313fc9329837dde67815901528a34dca98ebcc
Address comments left in the review for $subject. Change-Id: I69449112027736152c9fb62f5fe427efd6a25107 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
f57e10b903
commit
dd89efd5ac
@ -36,10 +36,7 @@ def _get_columns(item):
|
||||
|
||||
|
||||
def _format_addresses(addresses):
|
||||
ret = []
|
||||
for addr in addresses:
|
||||
ret.append(str(netaddr.IPNetwork(addr)))
|
||||
return ret
|
||||
return [str(netaddr.IPNetwork(addr)) for addr in addresses]
|
||||
|
||||
|
||||
def _get_attrs(client_manager, parsed_args):
|
||||
@ -185,7 +182,6 @@ class ListAddressGroup(command.Lister):
|
||||
parsed_args.project,
|
||||
parsed_args.project_domain,
|
||||
).id
|
||||
attrs['tenant_id'] = project_id
|
||||
attrs['project_id'] = project_id
|
||||
data = client.address_groups(**attrs)
|
||||
|
||||
|
@ -282,7 +282,7 @@ class TestListAddressGroup(TestAddressGroup):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.network.address_groups.assert_called_once_with(
|
||||
**{'tenant_id': project.id, 'project_id': project.id})
|
||||
project_id=project.id)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertItemsEqual(self.data, list(data))
|
||||
|
||||
@ -297,11 +297,10 @@ class TestListAddressGroup(TestAddressGroup):
|
||||
('project', project.id),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
filters = {'tenant_id': project.id, 'project_id': project.id}
|
||||
|
||||
self.network.address_groups.assert_called_once_with(**filters)
|
||||
self.network.address_groups.assert_called_once_with(
|
||||
project_id=project.id)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertItemsEqual(self.data, list(data))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user