From c38a82190242aeea3c3577cd7dde9fba8bb04d72 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Fri, 29 Mar 2019 10:03:48 +0100 Subject: [PATCH] Fix exception type in test_boot_reschedule_fill_provider_mapping_raises After Iecbee518444bd282ce5f6fd019db41a322f76a83 merged the test_boot_reschedule_fill_provider_mapping_raises does not simulate a possible scenario as ConsumerAllocationRetrievalFailed cannot be raised from _fill_provider_mapping any more. The fault this functional test reporduces still exists just with different exception types. So this patch changes the exception type to a valid one that is still raised by _fill_provider_mapping. Change-Id: I79cf44aafccb1bc6b13a3109c5a98215811bd04d Related-Bug: #1819460 (cherry picked from commit fd3b86d1c35efdd8356233863b8ad5b628df8d29) --- nova/tests/functional/test_servers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py index 067a3b86ee30..a639b4842825 100644 --- a/nova/tests/functional/test_servers.py +++ b/nova/tests/functional/test_servers.py @@ -6805,8 +6805,8 @@ class PortResourceRequestReSchedulingTest( '_fill_provider_mapping', side_effect=[ fill, - exception.ConsumerAllocationRetrievalFailed( - consumer_uuid=uuids.inst1, error='testing')], + exception.ResourceProviderTraitRetrievalFailed( + uuid=uuids.rp1)], autospec=True): server = self._create_server( flavor=self.flavor, @@ -6821,7 +6821,7 @@ class PortResourceRequestReSchedulingTest( # NOTE(gibi): Due to bug 1819460 the server stuck in BUILD state and no # error is presented to the user # self.assertIn( - # 'Failed to retrieve allocations for consumer', + # 'Failed to get traits for resource provider', # server['fault']['message']) # # NOTE(gibi): even after delete the allocation of such server is leaked