Hide 'nodes' field from chassis OSC subcommands output

Hide 'nodes' field from output of subcommands:
  * baremetal chassis create
  * baremetal chassis show

Change-Id: I1dc10abef99aaacbfb71c23e5d1d5848cefc963f
Closes-Bug: #1621021
This commit is contained in:
Kyrylo Romanenko 2016-09-07 15:41:35 +03:00
parent ae5e6c4152
commit 9f135f377c
3 changed files with 9 additions and 0 deletions

View File

@ -63,6 +63,7 @@ class CreateBaremetalChassis(command.ShowOne):
chassis = baremetal_client.chassis.create(**fields)._info chassis = baremetal_client.chassis.create(**fields)._info
chassis.pop('links', None) chassis.pop('links', None)
chassis.pop('nodes', None)
return self.dict2columns(chassis) return self.dict2columns(chassis)
@ -260,6 +261,7 @@ class ShowBaremetalChassis(command.ShowOne):
chassis = baremetal_client.chassis.get(parsed_args.chassis, chassis = baremetal_client.chassis.get(parsed_args.chassis,
fields=fields)._info fields=fields)._info
chassis.pop("links", None) chassis.pop("links", None)
chassis.pop("nodes", None)
return zip(*sorted(chassis.items())) return zip(*sorted(chassis.items()))

View File

@ -72,6 +72,7 @@ class TestChassisCreate(TestChassis):
collist = copy.copy(self.collist) collist = copy.copy(self.collist)
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
self.assertNotIn('nodes', columns)
datalist = copy.copy(self.datalist) datalist = copy.copy(self.datalist)
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
@ -431,6 +432,7 @@ class TestChassisShow(TestChassis):
'uuid' 'uuid'
) )
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
self.assertNotIn('nodes', columns)
datalist = ( datalist = (
baremetal_fakes.baremetal_chassis_description, baremetal_fakes.baremetal_chassis_description,
baremetal_fakes.baremetal_chassis_extra, baremetal_fakes.baremetal_chassis_extra,

View File

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