diff --git a/nova/tests/functional/regressions/test_bug_1928063.py b/nova/tests/functional/regressions/test_bug_1928063.py index b3a5f969cf01..b1b1d36e1681 100644 --- a/nova/tests/functional/regressions/test_bug_1928063.py +++ b/nova/tests/functional/regressions/test_bug_1928063.py @@ -17,7 +17,6 @@ from oslo_utils.fixture import uuidsentinel as uuids from nova import test from nova.tests.fixtures import libvirt as fakelibvirt -from nova.tests.functional.api import client from nova.tests.functional.libvirt import base from nova.virt.libvirt.host import SEV_KERNEL_PARAM_FILE @@ -58,12 +57,5 @@ class TestSEVInstanceReboot(base.ServersTestBase): networks='none' ) - # FIXME(lyarwood): This is bug #1928063, the instance fails to reboot - # due to a NotImplementedError exception being raised when we try to - # access image_meta.name as this isn't stashed in the system_metadata - # of the instance and as a result is not provided in the image_meta - # associated with the instance during this flow. - ex = self.assertRaises( - client.OpenStackApiException, - self._reboot_server, server, hard=True) - self.assertEqual(500, ex.response.status_code) + # Hard reboot the server + self._reboot_server(server, hard=True) diff --git a/nova/tests/unit/virt/test_hardware.py b/nova/tests/unit/virt/test_hardware.py index 82aace61d6ea..f5d88f580117 100644 --- a/nova/tests/unit/virt/test_hardware.py +++ b/nova/tests/unit/virt/test_hardware.py @@ -5421,7 +5421,7 @@ class MemEncryptionRequestedWithoutUEFITestCase( for image_prop in ('1', 'true', 'True'): self._test_encrypted_memory_support_no_uefi( None, image_prop, - "hw_mem_encryption property of image %s" % self.image_name) + "hw_mem_encryption property of image %s" % self.image_id) def test_flavor_image_require_encrypted_memory_support_no_uefi(self): for extra_spec in ('1', 'true', 'True'): @@ -5430,7 +5430,7 @@ class MemEncryptionRequestedWithoutUEFITestCase( extra_spec, image_prop, "hw:mem_encryption extra spec in %s flavor and " "hw_mem_encryption property of image %s" - % (self.flavor_name, self.image_name)) + % (self.flavor_name, self.image_id)) class MemEncryptionRequestedWithInvalidMachineTypeTestCase( @@ -5508,7 +5508,7 @@ class MemEncryptionRequiredTestCase(test.NoDBTestCase): self._test_encrypted_memory_support_required( {}, {'hw_mem_encryption': image_prop}, - "hw_mem_encryption property of image %s" % self.image_name + "hw_mem_encryption property of image %s" % self.image_id ) def test_require_encrypted_memory_support_both_required(self): @@ -5519,7 +5519,7 @@ class MemEncryptionRequiredTestCase(test.NoDBTestCase): {'hw_mem_encryption': image_prop}, "hw:mem_encryption extra spec in %s flavor and " "hw_mem_encryption property of image %s" % - (self.flavor_name, self.image_name) + (self.flavor_name, self.image_id) ) diff --git a/nova/virt/hardware.py b/nova/virt/hardware.py index 043ee648fa54..93a98f98ff50 100644 --- a/nova/virt/hardware.py +++ b/nova/virt/hardware.py @@ -1313,7 +1313,7 @@ def get_mem_encryption_constraint( flavor.name) if image_mem_enc: requesters.append("hw_mem_encryption property of image %s" % - image_meta.name) + image_meta.id) _check_mem_encryption_uses_uefi_image(requesters, image_meta) _check_mem_encryption_machine_type(image_meta, machine_type)