Merge "Hide 'ports' field from node OSC subcommands output"

This commit is contained in:
Jenkins 2016-09-21 13:31:46 +00:00 committed by Gerrit Code Review
commit 4194840935
3 changed files with 9 additions and 0 deletions

View File

@ -327,6 +327,7 @@ class CreateBaremetalNode(command.ShowOne):
node = baremetal_client.node.create(**fields)._info
node.pop('links', None)
node.pop('ports', None)
return self.dict2columns(node)
@ -965,6 +966,7 @@ class ShowBaremetalNode(command.ShowOne):
node = baremetal_client.node.get(
parsed_args.node, fields=fields)._info
node.pop("links", None)
node.pop("ports", None)
return zip(*sorted(node.items()))

View File

@ -278,6 +278,7 @@ class TestBaremetalCreate(TestBaremetal):
collist = copy.copy(self.collist)
self.assertEqual(collist, columns)
self.assertNotIn('ports', columns)
datalist = copy.copy(self.datalist)
self.assertEqual(datalist, tuple(data))
@ -1335,6 +1336,7 @@ class TestBaremetalShow(TestBaremetal):
'uuid'
)
self.assertEqual(collist, columns)
self.assertNotIn('ports', columns)
datalist = (
'yyy-yyyyyy-yyyy',
baremetal_fakes.baremetal_maintenance,

View File

@ -0,0 +1,5 @@
---
upgrade:
- Hide ports field in 'node create' and 'node show'
OSC subcommand output because this field is not meant
for CLI users.