]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Misuse of i18n log translation to output error message
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Tue, 24 Jun 2014 23:40:36 +0000 (19:40 -0400)
committerMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Thu, 26 Jun 2014 13:40:48 +0000 (09:40 -0400)
I found a misuse of i18n log translation for error message
in "cinder/volume/drivers/lvm.py'.

The "%s' can not be translated. In this case, the "message'
must be i18ning and then the "message" should be output
using LOG.error().

Change-Id: I4495522d337764dc28186225f4594a227ac3e555
Signed-off-by: Mitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Closes-Bug: 1334334

cinder/volume/drivers/lvm.py

index e3f539c10820ce2e564c40d276ed3d6343b0a7f6..dc98a78703ca2579501d774f42dca257a45d49b7 100644 (file)
@@ -573,9 +573,9 @@ class LVMISCSIDriver(LVMVolumeDriver, driver.ISCSIDriver):
             try:
                 (vg for vg in vg_list if vg['name'] == dest_vg).next()
             except StopIteration:
-                message = ("Destination Volume Group %s does not exist" %
+                message = (_("Destination Volume Group %s does not exist") %
                            dest_vg)
-                LOG.error(_('%s'), message)
+                LOG.error(message)
                 return false_ret
 
             helper = utils.get_root_helper()