Skip to content

Commit 1b9c4c7

Browse files
sbauzaElod Illes
authored andcommitted
Fix rebuild compute RPC API exception for rolling-upgrades
By I0d889691de1af6875603a9f0f174590229e7be18 we broke rebuild for Yoga or older computes. By I9660d42937ad62d647afc6be965f166cc5631392 we broke rebuild for Zed computes. Fixing this by making the parameters optional. Conflicts: nova/compute/manager.py NOTE(elod.illes): conflict is due to feature 'allowing target state for evacuate' I9660d42937ad62d647afc6be965f166cc5631392 was added in 2023.1 Antelope cycle. Change-Id: I0ca04045f8ac742e2b50490cbe5efccaee45c5c0 Closed-Bug: #2040264 (cherry picked from commit ee9ed0f) (cherry picked from commit 6b870ab) (cherry picked from commit edfb397)
1 parent e13c86b commit 1b9c4c7

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

nova/compute/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3637,7 +3637,7 @@ def rebuild_instance(self, context, instance, orig_image_ref, image_ref,
36373637
bdms, recreate, on_shared_storage,
36383638
preserve_ephemeral, migration,
36393639
scheduled_node, limits, request_spec, accel_uuids,
3640-
reimage_boot_volume):
3640+
reimage_boot_volume=None):
36413641
"""Destroy and re-make this instance.
36423642

36433643
A 'rebuild' effectively purges all existing data from the system and
@@ -3671,7 +3671,7 @@ def rebuild_instance(self, context, instance, orig_image_ref, image_ref,
36713671
:param accel_uuids: a list of cyborg ARQ uuids
36723672
:param reimage_boot_volume: Boolean to specify whether the user has
36733673
explicitly requested to rebuild a boot
3674-
volume
3674+
volume or None if RPC version is <=6.0
36753675

36763676
"""
36773677
# recreate=True means the instance is being evacuated from a failed

nova/tests/functional/regressions/test_bug_2040264.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# under the License.
1212

1313
from nova.tests import fixtures as nova_fixtures
14-
from nova.tests.functional.api import client
1514
from nova.tests.functional import integrated_helpers
1615

1716

@@ -46,13 +45,7 @@ def _test_rebuild_instance_with_compute_rpc_pin(self, version_cap):
4645

4746
# We automatically pin to 6.0 if old computes are Yoga or older.
4847
def test_rebuild_instance_6_0(self):
49-
e = self.assertRaises(client.OpenStackApiException,
50-
self._test_rebuild_instance_with_compute_rpc_pin, '6.0')
51-
self.assertEqual(500, e.response.status_code)
52-
# NOTE(sbauza): This returns a TypeError because of
53-
# 'reimage_boot_volume' and 'target_state' parameters missing from the
54-
# rcpapi caller.
55-
self.assertIn('TypeError', e.response.text)
48+
self._test_rebuild_instance_with_compute_rpc_pin('6.0')
5649

5750
# We automatically pin to 6.1 if old computes are Zed.
5851
def test_rebuild_instance_6_1(self):

0 commit comments

Comments
 (0)