diff --git a/ironic_inspector/node_cache.py b/ironic_inspector/node_cache.py index 0e9d748c9..3c75509b0 100644 --- a/ironic_inspector/node_cache.py +++ b/ironic_inspector/node_cache.py @@ -958,10 +958,9 @@ def record_node(ironic=None, bmc_addresses=None, macs=None): if node.provision_state not in ir_utils.VALID_ACTIVE_STATES: raise utils.Error(_("Node %(node)s is not active, its provision " "state is %(state)s") % - {'node': node.uuid, - 'state': node.provision_state}) + {'node': node.id, 'state': node.provision_state}) - return add_node(node.uuid, istate.States.waiting, + return add_node(node.id, istate.States.waiting, manage_boot=False, mac=macs, bmc_address=bmc_addresses) diff --git a/ironic_inspector/test/unit/test_node_cache.py b/ironic_inspector/test/unit/test_node_cache.py index 736090ada..6118afe73 100644 --- a/ironic_inspector/test/unit/test_node_cache.py +++ b/ironic_inspector/test/unit/test_node_cache.py @@ -1337,6 +1337,7 @@ class TestRecordNode(test_base.NodeTest): super(TestRecordNode, self).setUp() self.node.provision_state = 'active' self.ironic = mock.Mock(spec=['get_node']) + del self.node.uuid # no compatibility shim here self.ironic.get_node.return_value = self.node def test_no_lookup_data(self, mock_lookup): diff --git a/releasenotes/notes/node-id-920629472f01c83a.yaml b/releasenotes/notes/node-id-920629472f01c83a.yaml new file mode 100644 index 000000000..bcf5008bb --- /dev/null +++ b/releasenotes/notes/node-id-920629472f01c83a.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes ``AttributeError: 'Node' object has no attribute 'uuid'`` when + trying to introspect an active node that is not currently in the cache.