From 52b86381937c243cd076f09af2b8b4f603b48a33 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Tue, 24 Jul 2018 14:00:44 +0000 Subject: [PATCH] Add conductor_group to node notifications Adds the field, bumps the versions, adds to docs. Change-Id: I952a6c67135d84b93f178edce8e098a2d8200db4 Story: 2001795 Task: 23152 --- doc/source/admin/notifications.rst | 18 ++++++++++++------ ironic/objects/node.py | 17 ++++++++++++----- ironic/tests/unit/objects/test_objects.py | 10 +++++----- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/doc/source/admin/notifications.rst b/doc/source/admin/notifications.rst index 4d4bffe1d6..7ffa583d44 100644 --- a/doc/source/admin/notifications.rst +++ b/doc/source/admin/notifications.rst @@ -132,10 +132,11 @@ Example of node CRUD notification:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeCRUDPayload", - "ironic_object.version":"1.6", + "ironic_object.version":"1.8", "ironic_object.data":{ "chassis_uuid": "db0eef9d-45b2-4dc0-94a8-fc283c01171f", "clean_step": None, + "conductor_group": "", "console_enabled": False, "created_at": "2016-01-26T20:41:03+00:00", "deploy_step": None, @@ -360,9 +361,10 @@ node maintenance notification:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodePayload", - "ironic_object.version":"1.9", + "ironic_object.version":"1.10", "ironic_object.data":{ "clean_step": None, + "conductor_group": "", "console_enabled": False, "created_at": "2016-01-26T20:41:03+00:00", "driver": "ipmi", @@ -441,9 +443,10 @@ level, "error" has ERROR. Example of node console notification:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodePayload", - "ironic_object.version":"1.9", + "ironic_object.version":"1.10", "ironic_object.data":{ "clean_step": None, + "conductor_group": "", "console_enabled": True, "created_at": "2016-01-26T20:41:03+00:00", "driver": "ipmi", @@ -516,9 +519,10 @@ ironic-conductor is attempting to change the node:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeSetPowerStatePayload", - "ironic_object.version":"1.9", + "ironic_object.version":"1.10", "ironic_object.data":{ "clean_step": None, + "conductor_group": "", "console_enabled": False, "created_at": "2016-01-26T20:41:03+00:00", "deploy_step": None, @@ -585,9 +589,10 @@ prior to the correction:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeCorrectedPowerStatePayload", - "ironic_object.version":"1.9", + "ironic_object.version":"1.10", "ironic_object.data":{ "clean_step": None, + "conductor_group": "", "console_enabled": False, "created_at": "2016-01-26T20:41:03+00:00", "deploy_step": None, @@ -665,9 +670,10 @@ indicate a node's provision states before state change, "event" is the FSM "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeSetProvisionStatePayload", - "ironic_object.version":"1.9", + "ironic_object.version":"1.10", "ironic_object.data":{ "clean_step": None, + "conductor_group": "", "console_enabled": False, "created_at": "2016-01-26T20:41:03+00:00", "deploy_step": None, diff --git a/ironic/objects/node.py b/ironic/objects/node.py index 47d88fc796..dc45a6561d 100644 --- a/ironic/objects/node.py +++ b/ironic/objects/node.py @@ -622,6 +622,7 @@ class NodePayload(notification.NotificationPayloadBase): # - being internal-only or hardware-related fields SCHEMA = { 'clean_step': ('node', 'clean_step'), + 'conductor_group': ('node', 'conductor_group'), 'console_enabled': ('node', 'console_enabled'), 'created_at': ('node', 'created_at'), 'driver': ('node', 'driver'), @@ -668,9 +669,11 @@ class NodePayload(notification.NotificationPayloadBase): # Version 1.7: Add fault field exposed via API. # Version 1.8: Add bios interface field exposed via API. # Version 1.9: Add deploy_step field exposed via API. - VERSION = '1.9' + # Version 1.10: Add conductor_group field exposed via API. + VERSION = '1.10' fields = { 'clean_step': object_fields.FlexibleDictField(nullable=True), + 'conductor_group': object_fields.StringField(nullable=True), 'console_enabled': object_fields.BooleanField(nullable=True), 'created_at': object_fields.DateTimeField(nullable=True), 'deploy_step': object_fields.FlexibleDictField(nullable=True), @@ -743,7 +746,8 @@ class NodeSetPowerStatePayload(NodePayload): # Version 1.7: Parent NodePayload version 1.7 # Version 1.8: Parent NodePayload version 1.8 # Version 1.9: Parent NodePayload version 1.9 - VERSION = '1.9' + # Version 1.10: Parent NodePayload version 1.10 + VERSION = '1.10' fields = { # "to_power" indicates the future target_power_state of the node. A @@ -793,7 +797,8 @@ class NodeCorrectedPowerStatePayload(NodePayload): # Version 1.7: Parent NodePayload version 1.7 # Version 1.8: Parent NodePayload version 1.8 # Version 1.9: Parent NodePayload version 1.9 - VERSION = '1.9' + # Version 1.10: Parent NodePayload version 1.10 + VERSION = '1.10' fields = { 'from_power': object_fields.StringField(nullable=True) @@ -827,7 +832,8 @@ class NodeSetProvisionStatePayload(NodePayload): # Version 1.7: Parent NodePayload version 1.7 # Version 1.8: Parent NodePayload version 1.8 # Version 1.9: Parent NodePayload version 1.9 - VERSION = '1.9' + # Version 1.10: Parent NodePayload version 1.10 + VERSION = '1.10' SCHEMA = dict(NodePayload.SCHEMA, **{'instance_info': ('node', 'instance_info')}) @@ -868,7 +874,8 @@ class NodeCRUDPayload(NodePayload): # Version 1.5: Parent NodePayload version 1.7 # Version 1.6: Parent NodePayload version 1.8 # Version 1.7: Parent NodePayload version 1.9 - VERSION = '1.7' + # Version 1.8: Parent NodePayload version 1.10 + VERSION = '1.8' SCHEMA = dict(NodePayload.SCHEMA, **{'instance_info': ('node', 'instance_info'), diff --git a/ironic/tests/unit/objects/test_objects.py b/ironic/tests/unit/objects/test_objects.py index 2102302e5e..2e89f0ebb3 100644 --- a/ironic/tests/unit/objects/test_objects.py +++ b/ironic/tests/unit/objects/test_objects.py @@ -672,21 +672,21 @@ expected_object_fingerprints = { 'Conductor': '1.3-d3f53e853b4d58cae5bfbd9a8341af4a', 'EventType': '1.1-aa2ba1afd38553e3880c267404e8d370', 'NotificationPublisher': '1.0-51a09397d6c0687771fb5be9a999605d', - 'NodePayload': '1.9-c0aa5dd602adca3a28f091ca7848a41b', + 'NodePayload': '1.10-618d4ebd121671f463836b7c4ec45114', 'NodeSetPowerStateNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeSetPowerStatePayload': '1.9-07cd9053faa76199ffeaa45db78728a2', + 'NodeSetPowerStatePayload': '1.10-74b186077c80e13060de5e2dac9baed5', 'NodeCorrectedPowerStateNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeCorrectedPowerStatePayload': '1.9-321b389cd4aa2552da25a5001f7fcb71', + 'NodeCorrectedPowerStatePayload': '1.10-f85fc83dceda2d7ed356368cda0f008f', 'NodeSetProvisionStateNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeSetProvisionStatePayload': '1.9-995f311c21e5e54bf2183db4056542a5', + 'NodeSetProvisionStatePayload': '1.10-80e9581b0663dd47362f0b7ab19e4674', 'VolumeConnector': '1.0-3e0252c0ab6e6b9d158d09238a577d97', 'VolumeTarget': '1.0-0b10d663d8dae675900b2c7548f76f5e', 'ChassisCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'ChassisCRUDPayload': '1.0-dce63895d8186279a7dd577cffccb202', 'NodeCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeCRUDPayload': '1.7-af856321c0531f52be431217214d203a', + 'NodeCRUDPayload': '1.8-8086c2706c8f89db8294ab7511b9337b', 'PortCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'PortCRUDPayload': '1.2-233d259df442eb15cc584fae1fe81504', 'NodeMaintenanceNotification': '1.0-59acc533c11d306f149846f922739c15',