From 3426963552966af9feae2c79c7c53ee770a9523c Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 9 Sep 2020 15:14:46 -0700 Subject: [PATCH] Fix backup node lookup The node lookup code added in change I27201319f31cdc01605a3c5ae9ef4b4218e4a3f6 was slightly broken in that we call a method with a keyword arguemnt which doesn't exist. uuid versus node_uuid. It happens, it is a quick fix! Spotted on a metalsmith job: [-] Agent is requesting to perform an explicit node cache update. This is to pickup any chanages in the cache before deployment. [-] Failed to update node cache. Error lookup_node() got an unexpected keyword argument 'uuid' Change-Id: I59ecec65707a2f03918b233f1925395ebe59b8c4 --- ironic_python_agent/hardware.py | 2 +- ironic_python_agent/tests/unit/test_hardware.py | 2 +- ...auxillarly-node-lookup-argument-83d3f717c039e454.yaml | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-auxillarly-node-lookup-argument-83d3f717c039e454.yaml diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py index 399d70609..54ceaddd0 100644 --- a/ironic_python_agent/hardware.py +++ b/ironic_python_agent/hardware.py @@ -498,7 +498,7 @@ def update_cached_node(): hardware_info=list_hardware_info(use_cache=True), timeout=API_LOOKUP_TIMEOUT, starting_interval=API_LOOKUP_INTERVAL, - uuid=uuid) + node_uuid=uuid) cache_node(content['node']) return content['node'] except Exception as exc: diff --git a/ironic_python_agent/tests/unit/test_hardware.py b/ironic_python_agent/tests/unit/test_hardware.py index 0ab04b673..5dc76b504 100644 --- a/ironic_python_agent/tests/unit/test_hardware.py +++ b/ironic_python_agent/tests/unit/test_hardware.py @@ -4533,7 +4533,7 @@ class TestAPIClientSaveAndUse(base.IronicAgentTest): hardware_info=mock.ANY, timeout=1, starting_interval=2, - uuid='node1') + node_uuid='node1') self.assertEqual(updated_node, hardware.NODE) calls = [mock.call('list_hardware_info'), mock.call('wait_for_disks')] diff --git a/releasenotes/notes/fix-auxillarly-node-lookup-argument-83d3f717c039e454.yaml b/releasenotes/notes/fix-auxillarly-node-lookup-argument-83d3f717c039e454.yaml new file mode 100644 index 000000000..7731d8f4d --- /dev/null +++ b/releasenotes/notes/fix-auxillarly-node-lookup-argument-83d3f717c039e454.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Fixes a minor incorrect keyword argument that was + matching between the method caller and the unit test but + not the actual method, unit test, and caller. This was + a non-fatal issue, and should now permit the agent to + attempt to lookup the node one last time before deploying + the instance image to pick-up a root device hint.