diff --git a/ironicclient/osc/v1/baremetal_node.py b/ironicclient/osc/v1/baremetal_node.py index 0037ccfca..d907cb18c 100644 --- a/ironicclient/osc/v1/baremetal_node.py +++ b/ironicclient/osc/v1/baremetal_node.py @@ -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())) diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_node.py b/ironicclient/tests/unit/osc/v1/test_baremetal_node.py index ab7b73808..d59c1550a 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_node.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_node.py @@ -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, diff --git a/releasenotes/notes/osc-plugin-node-create-show-fix-283148c86fbccce2.yaml b/releasenotes/notes/osc-plugin-node-create-show-fix-283148c86fbccce2.yaml new file mode 100644 index 000000000..cfaba5796 --- /dev/null +++ b/releasenotes/notes/osc-plugin-node-create-show-fix-283148c86fbccce2.yaml @@ -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.