From 052ad71866e744ab2c62d26738ce710009aae8f9 Mon Sep 17 00:00:00 2001 From: Ruby Loo Date: Tue, 10 Jul 2018 21:57:31 +0000 Subject: [PATCH] Support node's deploy_step field Adds support for a node's ``deploy_step`` (read-only) field. The deploy step indicates which step is being performed during the deployment/provisioning of a node. It is available starting with Bare Metal API version 1.44. Depends-On: https://review.openstack.org/#/c/579968/ Change-Id: I93ac628bca0822a9a359926389543f7db7fb3e56 Story: #1753128 Task: #22925 --- ironicclient/common/http.py | 2 +- ironicclient/shell.py | 2 +- .../functional/osc/v1/test_baremetal_node_fields.py | 1 + ironicclient/tests/functional/test_json_response.py | 1 + ironicclient/tests/unit/osc/v1/test_baremetal_node.py | 3 ++- ironicclient/tests/unit/v1/test_node_shell.py | 1 + ironicclient/v1/resource_fields.py | 3 +++ .../notes/node-deploy-step-061e8925dfee3918.yaml | 9 +++++++++ 8 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/node-deploy-step-061e8925dfee3918.yaml diff --git a/ironicclient/common/http.py b/ironicclient/common/http.py index 9b4587a24..16de7ccfc 100644 --- a/ironicclient/common/http.py +++ b/ironicclient/common/http.py @@ -43,7 +43,7 @@ from ironicclient import exc # http://specs.openstack.org/openstack/ironic-specs/specs/kilo/api-microversions.html # noqa # for full details. DEFAULT_VER = '1.9' -LAST_KNOWN_API_VERSION = 42 +LAST_KNOWN_API_VERSION = 44 LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION) LOG = logging.getLogger(__name__) diff --git a/ironicclient/shell.py b/ironicclient/shell.py index 8343216e8..03f813ac6 100644 --- a/ironicclient/shell.py +++ b/ironicclient/shell.py @@ -38,7 +38,7 @@ from ironicclient.common import utils from ironicclient import exc -LAST_KNOWN_API_VERSION = 34 +LAST_KNOWN_API_VERSION = http.LAST_KNOWN_API_VERSION LATEST_VERSION = '1.{}'.format(LAST_KNOWN_API_VERSION) diff --git a/ironicclient/tests/functional/osc/v1/test_baremetal_node_fields.py b/ironicclient/tests/functional/osc/v1/test_baremetal_node_fields.py index 79f3a2d4c..dd19958ff 100644 --- a/ironicclient/tests/functional/osc/v1/test_baremetal_node_fields.py +++ b/ironicclient/tests/functional/osc/v1/test_baremetal_node_fields.py @@ -82,6 +82,7 @@ class TestNodeShowFields(base.TestCase): rows = ['console_enabled', 'clean_step', 'created_at', + 'deploy_step', 'driver', 'driver_info', 'driver_internal_info', diff --git a/ironicclient/tests/functional/test_json_response.py b/ironicclient/tests/functional/test_json_response.py index 73ecc126f..358826862 100644 --- a/ironicclient/tests/functional/test_json_response.py +++ b/ironicclient/tests/functional/test_json_response.py @@ -45,6 +45,7 @@ class TestNodeJsonResponse(base.FunctionalTestBase): "maintenance_reason": {"type": ["string", "null"]}, "provision_state": {"type": "string"}, "clean_step": {"type": "object"}, + "deploy_step": {"type": "object"}, "uuid": {"type": "string"}, "console_enabled": {"type": "boolean"}, "target_provision_state": {"type": ["string", "null"]}, diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_node.py b/ironicclient/tests/unit/osc/v1/test_baremetal_node.py index 589aa7b6d..bc12c037b 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_node.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_node.py @@ -594,7 +594,7 @@ class TestBaremetalList(TestBaremetal): ) collist = ('Chassis UUID', 'Created At', 'Clean Step', - 'Console Enabled', 'Driver', 'Driver Info', + 'Console Enabled', 'Deploy Step', 'Driver', 'Driver Info', 'Driver Internal Info', 'Extra', 'Instance Info', 'Instance UUID', 'Last Error', 'Maintenance', 'Maintenance Reason', 'Fault', @@ -621,6 +621,7 @@ class TestBaremetalList(TestBaremetal): '', '', '', + '', baremetal_fakes.baremetal_instance_uuid, '', baremetal_fakes.baremetal_maintenance, diff --git a/ironicclient/tests/unit/v1/test_node_shell.py b/ironicclient/tests/unit/v1/test_node_shell.py index 636b6bfec..df50d869c 100644 --- a/ironicclient/tests/unit/v1/test_node_shell.py +++ b/ironicclient/tests/unit/v1/test_node_shell.py @@ -37,6 +37,7 @@ class NodeShellTest(utils.BaseTestCase): 'clean_step', 'created_at', 'console_enabled', + 'deploy_step', 'driver', 'driver_info', 'driver_internal_info', diff --git a/ironicclient/v1/resource_fields.py b/ironicclient/v1/resource_fields.py index dbbbb3d61..a14306c60 100644 --- a/ironicclient/v1/resource_fields.py +++ b/ironicclient/v1/resource_fields.py @@ -53,6 +53,7 @@ class Resource(object): 'default_rescue_interface': 'Default Rescue Interface', 'default_storage_interface': 'Default Storage Interface', 'default_vendor_interface': 'Default Vendor Interface', + 'deploy_step': 'Deploy Step', 'description': 'Description', 'driver': 'Driver', 'driver_info': 'Driver Info', @@ -201,6 +202,7 @@ NODE_DETAILED_RESOURCE = Resource( 'created_at', 'clean_step', 'console_enabled', + 'deploy_step', 'driver', 'driver_info', 'driver_internal_info', @@ -246,6 +248,7 @@ NODE_DETAILED_RESOURCE = Resource( # internal to ironic. See bug #1443003 for more details. 'chassis_uuid', 'clean_step', + 'deploy_step', 'driver_info', 'driver_internal_info', 'extra', diff --git a/releasenotes/notes/node-deploy-step-061e8925dfee3918.yaml b/releasenotes/notes/node-deploy-step-061e8925dfee3918.yaml new file mode 100644 index 000000000..39ba6390e --- /dev/null +++ b/releasenotes/notes/node-deploy-step-061e8925dfee3918.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Adds support for a node's ``deploy_step`` (read-only) field. + The deploy step indicates which step is being performed + during the deployment/provisioning of a node. + It is available starting with Bare Metal API version 1.44. + For more details, see + `story 1753128 `_.