diff --git a/nova/exception.py b/nova/exception.py index b7a01300c4..28cc7ace94 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -2245,7 +2245,7 @@ class PlacementReshapeConflict(PlacementAPIConflict): """ msg_fmt = _( "A conflict was encountered attempting to reshape a provider tree: " - "$(error)s" + "%(error)s" ) diff --git a/nova/tests/functional/test_report_client.py b/nova/tests/functional/test_report_client.py index a127072351..a3e81c7022 100644 --- a/nova/tests/functional/test_report_client.py +++ b/nova/tests/functional/test_report_client.py @@ -1569,13 +1569,17 @@ class SchedulerReportClientTests(test.TestCase): # So we expect that it is signalled with an exception so that the # upper layer can re-drive the reshape process with a fresh tree that # now has the inventories - self.assertRaises( + ex = self.assertRaises( exception.PlacementReshapeConflict, self.client.update_from_provider_tree, self.context, ptree, allocations=allocs, ) + ex_msg = str(ex) + self.assertNotIn('$', ex_msg) + self.assertIn("A conflict was encountered attempting to reshape " + "a provider tree", ex_msg) # also we except that the internal caches is cleared so that the # re-drive will have a chance to load fresh data from placement self.assertEqual(0, len(self.client._provider_tree.roots))