From ce910bc92ea6d49a5c9017efafe10f3d29604e90 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Tue, 30 Jun 2015 09:16:26 +1000 Subject: [PATCH] Cleanup log lines in nova.image.glance These were inconsistent, occassionally had the wrong translation marker, and sometimes were substituting variables incorrectly. No functional changes, just a cleanup. Change-Id: I05578f497fc863ad453bba277072b8e4893006bf --- nova/image/glance.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/nova/image/glance.py b/nova/image/glance.py index 2add21eb43..ac733e86ad 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -37,7 +37,7 @@ from six.moves import range import six.moves.urllib.parse as urlparse from nova import exception -from nova.i18n import _, _LE, _LW +from nova.i18n import _LE, _LI, _LW import nova.image.download as image_xfers @@ -236,12 +236,11 @@ class GlanceClientWrapper(object): else: extra = 'done trying' - error_msg = (_("Error contacting glance server " - "'%(host)s:%(port)s' for '%(method)s', " - "%(extra)s.") % - {'host': host, 'port': port, - 'method': method, 'extra': extra}) - LOG.exception(error_msg) + LOG.exception(_LE("Error contacting glance server " + "'%(host)s:%(port)s' for '%(method)s', " + "%(extra)s."), + {'host': host, 'port': port, + 'method': method, 'extra': extra}) if attempt == num_attempts: raise exception.GlanceConnectionFailed( host=host, port=port, reason=six.text_type(e)) @@ -349,9 +348,8 @@ class GlanceImageService(object): if xfer_mod: try: xfer_mod.download(context, o, dst_path, loc_meta) - msg = _("Successfully transferred " - "using %s") % o.scheme - LOG.info(msg) + LOG.info(_LI("Successfully transferred " + "using %s"), o.scheme) return except Exception: LOG.exception(_LE("Download image error"))