summaryrefslogtreecommitdiff
path: root/nova/tests
diff options
context:
space:
mode:
authorPierre-Samuel Le Stang <pierre-samuel.le-stang@corp.ovh.com>2021-09-06 08:44:37 +0000
committerBalazs Gibizer <gibi@redhat.com>2022-05-23 11:10:40 +0200
commit076f95371a093a0e594c0d08e410676c9a73c9d0 (patch)
tree72b6e1d9b47647ae974b9389b7430b1cfdf7a49e /nova/tests
parentec73ff1f78714eb62686d0f39fc4e79ffdf559af (diff)
downloadnova-076f95371a093a0e594c0d08e410676c9a73c9d0.tar.gz
Fix instance's image_ref lost on failed unshelving
Closes-Bug: #1934094 Signed-off-by: Pierre-Samuel Le Stang <pierre-samuel.le-stang@corp.ovh.com> Change-Id: Id908a7224ff3378b3b51726bbfa8b5805d38ca59 (cherry picked from commit 518b952bdeb6ec29252b56527b8c8d7b32abe1b5)
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/unit/compute/test_shelve.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/nova/tests/unit/compute/test_shelve.py b/nova/tests/unit/compute/test_shelve.py
index 725f21bf35..a50b4ca4de 100644
--- a/nova/tests/unit/compute/test_shelve.py
+++ b/nova/tests/unit/compute/test_shelve.py
@@ -684,8 +684,7 @@ class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
https://bugs.launchpad.net/nova/+bug/1934094
"""
instance = self._create_fake_instance_obj()
- # TODO(pslestang) to uncomment when bug 1934094 is fixed
- # initial_image_ref = instance.image_ref
+ initial_image_ref = instance.image_ref
fake_spec = objects.RequestSpec()
shelved_image = {'id': uuids.image_id}
@@ -696,10 +695,7 @@ class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
self.compute.unshelve_instance, self.context, instance,
image=shelved_image, filter_properties={},
node='fake-node', request_spec=fake_spec, accel_uuids=[])
- # FIXME(pslestang) Until bug 1934094 is fixed
- # The instance.image_ref is set to shelved_image.id but should be
- # equal to initial_image_ref
- self.assertEqual(instance.image_ref, shelved_image['id'])
+ self.assertEqual(instance.image_ref, initial_image_ref)
@mock.patch.object(objects.InstanceList, 'get_by_filters')
def test_shelved_poll_none_offloaded(self, mock_get_by_filters):