From 3021172d9f650b546dd1bec48b25e26805f5ff84 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 7 Sep 2013 15:15:56 +0200 Subject: [PATCH] Put formatting operation outside localisation call Otherwise the strings will not be properly extracted for translation. Change-Id: I21a1c56577e7cd9fb2e31fe380b3c3bc8d1c48bf --- glance/common/property_utils.py | 6 +++--- glance/image_cache/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glance/common/property_utils.py b/glance/common/property_utils.py index 65bf8cd795..4e13b8feb3 100644 --- a/glance/common/property_utils.py +++ b/glance/common/property_utils.py @@ -55,7 +55,7 @@ class PropertyRules(object): conf_file = CONF.find_file(CONF.property_protection_file) CONFIG.read(conf_file) except Exception as e: - msg = _("Couldn't find property protection file %s:%s." % + msg = (_("Couldn't find property protection file %s:%s.") % (CONF.property_protection_file, e)) LOG.error(msg) raise webob.exc.HTTPInternalServerError(explanation=msg) @@ -85,8 +85,8 @@ class PropertyRules(object): try: return re.compile(rule) except Exception as e: - msg = _("Encountered a malformed property protection rule %s:%s." - % (rule, e)) + msg = (_("Encountered a malformed property protection rule %s:%s.") + % (rule, e)) LOG.error(msg) raise webob.exc.HTTPInternalServerError(explanation=msg) diff --git a/glance/image_cache/__init__.py b/glance/image_cache/__init__.py index 998ac892b0..4f6188242e 100644 --- a/glance/image_cache/__init__.py +++ b/glance/image_cache/__init__.py @@ -246,7 +246,7 @@ class ImageCache(object): if (image_checksum and image_checksum != current_checksum.hexdigest()): msg = _("Checksum verification failed. Aborted " - "caching of image '%s'." % image_id) + "caching of image '%s'.") % image_id raise exception.GlanceException(msg) except exception.GlanceException as e: