From fcceb93bc842ee2ba61dd21205d09c66d1f08634 Mon Sep 17 00:00:00 2001 From: Kun Huang Date: Thu, 5 Sep 2013 13:45:43 +0800 Subject: [PATCH] fix conversion type missing Conversion type is missing in some places which would cause some unexcepted error. By using 'grep -rn "%(\w\+)[^\%a-z0-9\.\-]"', we could find all cases of '%(variable_a)' and fix them. Change-Id: Id4b376a92ad23db2cb5380be85d4fe937f1a5cb7 Closes-Bug: #1221026 --- nova/exception.py | 2 +- nova/tests/virt/xenapi/test_vm_utils.py | 2 +- nova/virt/xenapi/vm_utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/exception.py b/nova/exception.py index 04fdec112bed..ef4ea8d22a14 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -1456,7 +1456,7 @@ class PciConfigInvalidWhitelist(Invalid): class PciTrackerInvalidNodeId(NovaException): - mst_fmt = _("Cannot change %(node_id)s to %(new_node_id)") + mst_fmt = _("Cannot change %(node_id)s to %(new_node_id)s") # Cannot be templated, msg needs to be constructed when raised. diff --git a/nova/tests/virt/xenapi/test_vm_utils.py b/nova/tests/virt/xenapi/test_vm_utils.py index 244f3fbd3824..9a5b81480025 100644 --- a/nova/tests/virt/xenapi/test_vm_utils.py +++ b/nova/tests/virt/xenapi/test_vm_utils.py @@ -425,7 +425,7 @@ class ResizeHelpersTestCase(test.TestCase): self.mox.StubOutWithMock(vm_utils.LOG, "debug") vm_utils.LOG.debug(_("Sparse copy in progress, " "%(complete_pct).2f%% complete. " - "%(left) bytes left to copy"), + "%(left)s bytes left to copy"), {"complete_pct": 50.0, "left": 1}) current = timeutils.utcnow() timeutils.set_time_override(current) diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index de170886fe49..fe16dff9b626 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -2094,7 +2094,7 @@ def _log_progress_if_required(left, last_log_time, virtual_size): complete_pct = float(virtual_size - left) / virtual_size * 100 LOG.debug(_("Sparse copy in progress, " "%(complete_pct).2f%% complete. " - "%(left) bytes left to copy"), + "%(left)s bytes left to copy"), {"complete_pct": complete_pct, "left": left}) return last_log_time

AltStyle によって変換されたページ (->オリジナル) /