From 5895566a428be4c30c31ae94070282566a6cc568 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 31 Jan 2018 11:11:32 +0000 Subject: [PATCH] Add resource_class to fields in ironic node cache Per the discussion in [1], the ironic nodes added to the node cache in the ironic virt driver may be missing the required field resource_class, as this field is not in _NODE_FIELDS. In practice, this is typically not an issue (possibly never), as the normal code path uses a detailed list to sync all ironic nodes, which contain all fields (including resource_class). However, some code paths use a single node query with the fields limited to _NODE_FIELDS, so could result in a node in the cache without a resource_class. This change adds resource_class to _NODE_FIELDS. [1] https://review.openstack.org/#/c/532288/9/nova/virt/ironic/driver.py@79 Change-Id: Id84b4a47d05532d341a9b6ca2de7e9e66e1930da Closes-Bug: #1746209 --- nova/virt/ironic/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py index ec23ba03c0d4..eae54b57ac73 100644 --- a/nova/virt/ironic/driver.py +++ b/nova/virt/ironic/driver.py @@ -76,7 +76,7 @@ _UNPROVISION_STATES = (ironic_states.ACTIVE, ironic_states.DEPLOYFAIL, _NODE_FIELDS = ('uuid', 'power_state', 'target_power_state', 'provision_state', 'target_provision_state', 'last_error', 'maintenance', - 'properties', 'instance_uuid', 'traits') + 'properties', 'instance_uuid', 'traits', 'resource_class') # Console state checking interval in seconds _CONSOLE_STATE_CHECKING_INTERVAL = 1