Merge "Allow port list to shown undefined attributes"
This commit is contained in:
commit
e157365d86
@ -584,9 +584,11 @@ class ListPort(command.Lister):
|
|||||||
|
|
||||||
data = network_client.ports(**filters)
|
data = network_client.ports(**filters)
|
||||||
|
|
||||||
return (column_headers,
|
headers, attrs = utils.calculate_header_and_attrs(
|
||||||
|
column_headers, columns, parsed_args)
|
||||||
|
return (headers,
|
||||||
(utils.get_item_properties(
|
(utils.get_item_properties(
|
||||||
s, columns,
|
s, attrs,
|
||||||
formatters=_formatters,
|
formatters=_formatters,
|
||||||
) for s in data))
|
) for s in data))
|
||||||
|
|
||||||
|
@ -131,6 +131,16 @@ class PortTests(common.NetworkTagTests):
|
|||||||
self.assertNotIn(mac1, item_map.values())
|
self.assertNotIn(mac1, item_map.values())
|
||||||
self.assertIn(mac2, item_map.values())
|
self.assertIn(mac2, item_map.values())
|
||||||
|
|
||||||
|
# Test list with unknown fields
|
||||||
|
json_output = json.loads(self.openstack(
|
||||||
|
'port list -f json -c ID -c Name -c device_id'
|
||||||
|
))
|
||||||
|
id_list = [p['ID'] for p in json_output]
|
||||||
|
self.assertIn(id1, id_list)
|
||||||
|
self.assertIn(id2, id_list)
|
||||||
|
# Check an unknown field exists
|
||||||
|
self.assertIn('device_id', json_output[0])
|
||||||
|
|
||||||
def test_port_set(self):
|
def test_port_set(self):
|
||||||
"""Test create, set, show, delete"""
|
"""Test create, set, show, delete"""
|
||||||
name = uuid.uuid4().hex
|
name = uuid.uuid4().hex
|
||||||
|
Loading…
Reference in New Issue
Block a user