Use node.id instead of node.uuid in record_node
This function does not have a compatibility shim that adds 'uuid'.
Change-Id: I131c8189b25ee2de66f08c742a21052ef1b266aa
(cherry picked from commit 06390e3723
)
This commit is contained in:
parent
c4b29de9a0
commit
4cb904fb13
@ -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)
|
||||
|
||||
|
||||
|
@ -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):
|
||||
|
5
releasenotes/notes/node-id-920629472f01c83a.yaml
Normal file
5
releasenotes/notes/node-id-920629472f01c83a.yaml
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user