From 9f135f377c8a5b644635bf60c3c2ddc81d0c08e9 Mon Sep 17 00:00:00 2001 From: Kyrylo Romanenko Date: Wed, 7 Sep 2016 15:41:35 +0300 Subject: [PATCH] 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 --- ironicclient/osc/v1/baremetal_chassis.py | 2 ++ ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py | 2 ++ .../osc-plugin-chassis-create-show-fix-ee276d707c5a5bdf.yaml | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 releasenotes/notes/osc-plugin-chassis-create-show-fix-ee276d707c5a5bdf.yaml diff --git a/ironicclient/osc/v1/baremetal_chassis.py b/ironicclient/osc/v1/baremetal_chassis.py index c68b25f27..6bb8fc13c 100644 --- a/ironicclient/osc/v1/baremetal_chassis.py +++ b/ironicclient/osc/v1/baremetal_chassis.py @@ -63,6 +63,7 @@ class CreateBaremetalChassis(command.ShowOne): chassis = baremetal_client.chassis.create(**fields)._info chassis.pop('links', None) + chassis.pop('nodes', None) return self.dict2columns(chassis) @@ -260,6 +261,7 @@ class ShowBaremetalChassis(command.ShowOne): chassis = baremetal_client.chassis.get(parsed_args.chassis, fields=fields)._info chassis.pop("links", None) + chassis.pop("nodes", None) return zip(*sorted(chassis.items())) diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py b/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py index a7b3e4664..df65b5be7 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py @@ -72,6 +72,7 @@ class TestChassisCreate(TestChassis): collist = copy.copy(self.collist) self.assertEqual(collist, columns) + self.assertNotIn('nodes', columns) datalist = copy.copy(self.datalist) self.assertEqual(datalist, tuple(data)) @@ -431,6 +432,7 @@ class TestChassisShow(TestChassis): 'uuid' ) self.assertEqual(collist, columns) + self.assertNotIn('nodes', columns) datalist = ( baremetal_fakes.baremetal_chassis_description, baremetal_fakes.baremetal_chassis_extra, diff --git a/releasenotes/notes/osc-plugin-chassis-create-show-fix-ee276d707c5a5bdf.yaml b/releasenotes/notes/osc-plugin-chassis-create-show-fix-ee276d707c5a5bdf.yaml new file mode 100644 index 000000000..bbe1ede91 --- /dev/null +++ b/releasenotes/notes/osc-plugin-chassis-create-show-fix-ee276d707c5a5bdf.yaml @@ -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.