Merge "Do not show chassis_uuid field when it is not specified"
This commit is contained in:
commit
4ea6cf1181
@ -1113,7 +1113,8 @@ class ShowBaremetalNode(command.ShowOne):
|
||||
node.pop("ports", None)
|
||||
node.pop('portgroups', None)
|
||||
|
||||
node.setdefault('chassis_uuid', '')
|
||||
if not fields or 'chassis_uuid' in fields:
|
||||
node.setdefault('chassis_uuid', '')
|
||||
|
||||
return self.dict2columns(node)
|
||||
|
||||
|
@ -2090,7 +2090,8 @@ class TestBaremetalShow(TestBaremetal):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
# DisplayCommandBase.take_action() returns two tuples
|
||||
self.cmd.take_action(parsed_args)
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.assertNotIn('chassis_uuid', columns)
|
||||
|
||||
# Set expected values
|
||||
args = ['xxxxx']
|
||||
@ -2113,8 +2114,8 @@ class TestBaremetalShow(TestBaremetal):
|
||||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.assertNotIn('chassis_uuid', columns)
|
||||
# Set expected values
|
||||
args = ['xxxxx']
|
||||
fields = ['uuid', 'name', 'extra']
|
||||
|
Loading…
Reference in New Issue
Block a user