Merge "Return the `port` column headers expected in the list command"
This commit is contained in:
@@ -943,15 +943,12 @@ class ListPort(command.Lister):
|
|||||||
for item in columns
|
for item in columns
|
||||||
]
|
]
|
||||||
|
|
||||||
headers, attrs = utils.calculate_header_and_attrs(
|
|
||||||
column_headers, columns, parsed_args
|
|
||||||
)
|
|
||||||
return (
|
return (
|
||||||
headers,
|
column_headers,
|
||||||
(
|
(
|
||||||
utils.get_item_properties(
|
utils.get_item_properties(
|
||||||
s,
|
s,
|
||||||
attrs,
|
columns,
|
||||||
formatters=_list_formatters,
|
formatters=_list_formatters,
|
||||||
)
|
)
|
||||||
for s in data
|
for s in data
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from tempest.lib import exceptions as tempest_exc
|
||||||
|
|
||||||
from openstackclient.tests.functional.network.v2 import common
|
from openstackclient.tests.functional.network.v2 import common
|
||||||
|
|
||||||
|
|
||||||
@@ -162,8 +164,16 @@ class PortTests(common.NetworkTagTests):
|
|||||||
id_list = [p['ID'] for p in json_output]
|
id_list = [p['ID'] for p in json_output]
|
||||||
self.assertIn(id1, id_list)
|
self.assertIn(id1, id_list)
|
||||||
self.assertIn(id2, id_list)
|
self.assertIn(id2, id_list)
|
||||||
# Check an unknown field exists
|
# Check an unknown field does not exist
|
||||||
self.assertIn('device_id', json_output[0])
|
self.assertNotIn('device_id', json_output[0])
|
||||||
|
|
||||||
|
# Test list with only unknown fields
|
||||||
|
exc = self.assertRaises(
|
||||||
|
tempest_exc.CommandFailed,
|
||||||
|
self.openstack,
|
||||||
|
'port list -c device_id',
|
||||||
|
)
|
||||||
|
self.assertIn("No recognized column names in ['device_id']", str(exc))
|
||||||
|
|
||||||
def test_port_set(self):
|
def test_port_set(self):
|
||||||
"""Test create, set, show, delete"""
|
"""Test create, set, show, delete"""
|
||||||
|
|||||||
Reference in New Issue
Block a user