Fix string format specifier

This change fixes string format specifier from $ to % for
correct formatting.

Closes-Bug: #2123840
Signed-off-by: Rajesh Tailor <ratailor@redhat.com>
Change-Id: I04f6e1ba3eff443d40a13c6fe2d0b77a78a020e6
This commit is contained in:
Rajesh Tailor
2025-09-15 16:00:41 +05:30
parent 640782207c
commit ca158f2da3
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -2245,7 +2245,7 @@ class PlacementReshapeConflict(PlacementAPIConflict):
"""
msg_fmt = _(
"A conflict was encountered attempting to reshape a provider tree: "
"$(error)s"
"%(error)s"
)
+5 -1
View File
@@ -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))