diff --git a/nova/tests/unit/virt/ironic/test_driver.py b/nova/tests/unit/virt/ironic/test_driver.py index cd1b935290..d1db4a4feb 100644 --- a/nova/tests/unit/virt/ironic/test_driver.py +++ b/nova/tests/unit/virt/ironic/test_driver.py @@ -2219,8 +2219,9 @@ class IronicDriverTestCase(test.NoDBTestCase): mock_add_instance_info.assert_called_once_with( node, instance, test.MatchType(objects.ImageMeta), + flavor, test.MatchType(driver.InstanceDriverMetadata), - flavor, preserve) + preserve_ephemeral=preserve) self.mock_conn.set_node_provision_state.assert_called_once_with( node_uuid, ironic_states.REBUILD, config_drive=mock.ANY, ) diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py index 9d6bd32126..7b54f1d0be 100644 --- a/nova/virt/ironic/driver.py +++ b/nova/virt/ironic/driver.py @@ -1742,8 +1742,9 @@ class IronicDriver(virt_driver.ComputeDriver): node = self._get_node(node_id) metadata = self.get_instance_driver_metadata(instance, network_info) - self._add_instance_info_to_node(node, instance, image_meta, metadata, - instance.flavor, preserve_ephemeral) + self._add_instance_info_to_node(node, instance, image_meta, + instance.flavor, metadata, + preserve_ephemeral=preserve_ephemeral) # Config drive configdrive_value = None diff --git a/releasenotes/notes/bug-2092570-fix-parameter-order-in-add_instance_info_to_node.yaml b/releasenotes/notes/bug-2092570-fix-parameter-order-in-add_instance_info_to_node.yaml new file mode 100644 index 0000000000..7e1da8e9d6 --- /dev/null +++ b/releasenotes/notes/bug-2092570-fix-parameter-order-in-add_instance_info_to_node.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixed an issue where the instance rebuild option failed for Ironic instances. + The problem was caused by an incorrect parameter order in the ``add_instance_info_to_node`` + function, which was introduced by commit `93b90d2b` . + For more details, see `bug 2092570` .