diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 59fa18ee53fb..d9363f60c41e 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3747,7 +3747,7 @@ class ComputeManager(manager.Manager): bdms, recreate, on_shared_storage, preserve_ephemeral, migration, scheduled_node, limits, request_spec, accel_uuids, - reimage_boot_volume, target_state): + reimage_boot_volume=None, target_state=None): """Destroy and re-make this instance. A 'rebuild' effectively purges all existing data from the system and @@ -3781,8 +3781,9 @@ class ComputeManager(manager.Manager): :param accel_uuids: a list of cyborg ARQ uuids :param reimage_boot_volume: Boolean to specify whether the user has explicitly requested to rebuild a boot - volume - :param target_state: Set a target state for the evacuated instance. + volume or None if RPC version is <=6.0 + :param target_state: Set a target state for the evacuated instance or + None if RPC version is <=6.1. """ # recreate=True means the instance is being evacuated from a failed diff --git a/nova/tests/functional/regressions/test_bug_2040264.py b/nova/tests/functional/regressions/test_bug_2040264.py index 1de43b8a9207..c0e88c1154b5 100644 --- a/nova/tests/functional/regressions/test_bug_2040264.py +++ b/nova/tests/functional/regressions/test_bug_2040264.py @@ -11,7 +11,6 @@ # under the License. from nova.tests import fixtures as nova_fixtures -from nova.tests.functional.api import client from nova.tests.functional import integrated_helpers @@ -46,23 +45,11 @@ class ComputeVersion6xPinnedRpcTests(integrated_helpers._IntegratedTestBase): # We automatically pin to 6.0 if old computes are Yoga or older. def test_rebuild_instance_6_0(self): - e = self.assertRaises(client.OpenStackApiException, - self._test_rebuild_instance_with_compute_rpc_pin, '6.0') - self.assertEqual(500, e.response.status_code) - # NOTE(sbauza): This returns a TypeError because of - # 'reimage_boot_volume' and 'target_state' parameters missing from the - # rcpapi caller. - self.assertIn('TypeError', e.response.text) + self._test_rebuild_instance_with_compute_rpc_pin('6.0') # We automatically pin to 6.1 if old computes are Zed. def test_rebuild_instance_6_1(self): - e = self.assertRaises(client.OpenStackApiException, - self._test_rebuild_instance_with_compute_rpc_pin, '6.1') - self.assertEqual(500, e.response.status_code) - # NOTE(sbauza): This returns a TypeError because of - # 'reimage_boot_volume' and 'target_state' parameters missing from the - # rcpapi caller. - self.assertIn('TypeError', e.response.text) + self._test_rebuild_instance_with_compute_rpc_pin('6.1') # We automatically pin to 6.2 if old computes are 2023.1. def test_rebuild_instance_6_2(self):