Hide 'ports' field from node OSC subcommands output

Hide 'ports' field from output of subcommands:
  * baremetal node create
  * baremetal node show

Change-Id: Iff42e49a1d2b0b9fe380834bdbcd78760b7ba281
Closes-Bug: #1620737
This commit is contained in:
Kyrylo Romanenko 2016-09-07 14:54:27 +03:00
parent ae5e6c4152
commit 728063c1af
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.