]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix messages in EMC VMAX driver with no translation
authorJay S. Bryant <jsbryant@us.ibm.com>
Wed, 19 Nov 2014 21:01:10 +0000 (15:01 -0600)
committerJay S. Bryant <jsbryant@us.ibm.com>
Sat, 22 Nov 2014 17:09:41 +0000 (11:09 -0600)
There were a number of messages in the EMC VMAX driver
for LOG.info, LOG.error and LOG.warning that had no translation
marker on them.  This patch adds the appropriate _LI, _LE or _LW
marker so that the message will be translated.  Since there is
a separate effort to add in the log level markers going on I
did not attempt, in this patch, to address that issue.  Just
thought we should get translation on the messages that were missing it.

Change-Id: If6ac19369b303466afdec98589afa80ac46ad0f2

cinder/volume/drivers/emc/emc_vmax_common.py
cinder/volume/drivers/emc/emc_vmax_fc.py
cinder/volume/drivers/emc/emc_vmax_masking.py

index ae7d9ce3dbdc14cd7ad59c078b469ac12f54a455..2d88a4e2ac8349f0779aad2aec79aa2c0ef17aed 100644 (file)
@@ -1136,7 +1136,7 @@ class EMCVMAXCommon(object):
             LOG.error(errorMessage)
             return falseRet
 
-        LOG.info("Volume status is: %s" % volumeStatus)
+        LOG.info(_LI("Volume status is: %s"), volumeStatus)
         if (host['capabilities']['storage_protocol'] != self.protocol and
                 (volumeStatus != 'available' and volumeStatus != 'retyping')):
             errorMessage = (_(
@@ -1164,7 +1164,7 @@ class EMCVMAXCommon(object):
         # If there are no extra specs then the default case is assumed
         if extraSpecs:
             configGroup = self.configuration.config_group
-            LOG.info("configGroup of current host: %s" % configGroup)
+            LOG.info(_LI("configGroup of current host: %s"), configGroup)
 
         configurationFile = self._register_config_file_from_config_group(
             configGroup)
@@ -2154,9 +2154,9 @@ class EMCVMAXCommon(object):
         volumename = volume['name']
         vol_instance = self._find_lun(volume)
         if vol_instance is None:
-            msg = ("Volume %(name)s not found on the array. "
-                   "Cannot determine if there are volumes mapped."
-                   {'name': volumename})
+            msg = (_("Volume %(name)s not found on the array. "
+                     "Cannot determine if there are volumes mapped."),
+                   {'name': volumename})
             LOG.error(msg)
             raise exception.VolumeBackendAPIException(data=msg)
 
@@ -2202,9 +2202,10 @@ class EMCVMAXCommon(object):
         targetWwns = []
         mvInstanceName = self.get_masking_view_by_volume(volume)
         targetWwns = self.masking.get_target_wwns(self.conn, mvInstanceName)
-        LOG.info("Target wwns in masking view %(maskingView)s: %(targetWwns)s"
-                 % {'maskingView': mvInstanceName,
-                    'targetWwns': str(targetWwns)})
+        LOG.info(_LI("Target wwns in masking view %(maskingView)s: "
+                     "%(targetWwns)s"),
+                 {'maskingView': mvInstanceName,
+                  'targetWwns': str(targetWwns)})
         return targetWwns
 
     def get_port_group_from_masking_view(self, maskingViewInstanceName):
index abc6f445bd07067cb24c3d16a010b260964f2768..53dc26b45fb8065e032fe1be494b4ac7f4aa5c77 100644 (file)
@@ -15,6 +15,7 @@
 import six
 
 from cinder import context
+from cinder.i18n import _LI
 from cinder.openstack.common import log as logging
 from cinder.volume import driver
 from cinder.volume.drivers.emc import emc_vmax_common
@@ -182,7 +183,7 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver):
         loc = volume['provider_location']
         name = eval(loc)
         storage_system = name['keybindings']['SystemName']
-        LOG.info("Start FC detach process for volume: %(volume)s"
+        LOG.info(_LI("Start FC detach process for volume: %(volume)s")
                  % {'volume': volume['name']})
 
         target_wwns, init_targ_map = self._build_initiator_target_map(
@@ -192,15 +193,15 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver):
         portGroupInstanceName = self.common.get_port_group_from_masking_view(
             mvInstanceName)
 
-        LOG.info("Found port group: %(portGroup)s "
-                 "in masking view %(maskingView)s"
-                 {'portGroup': portGroupInstanceName,
-                    'maskingView': mvInstanceName})
+        LOG.info(_LI("Found port group: %(portGroup)s "
+                     "in masking view %(maskingView)s"),
+                 {'portGroup': portGroupInstanceName,
+                  'maskingView': mvInstanceName})
 
         self.common.terminate_connection(volume, connector)
 
-        LOG.info("Looking for masking views still associated with"
-                 "Port Group %s" % portGroupInstanceName)
+        LOG.info(_LI("Looking for masking views still associated with"
+                     "Port Group %s"), portGroupInstanceName)
         mvInstances = self.common.get_masking_views_by_port_group(
             portGroupInstanceName)
         if len(mvInstances) > 0:
index dd3324ad45fe2a336b82d30a37258fc70931b609..fefb7408d39d63fe257aac3c46755380bd3b4525 100644 (file)
@@ -813,7 +813,7 @@ class EMCVMAXMasking(object):
                     " %(fastPolicyName)s. ")
                     % {'volumeName': volumeName,
                        'fastPolicyName': fastPolicyName})
-                LOG.warn("No storage group found. " + infoMessage)
+                LOG.warning(_LW("No storage group found. %s"), infoMessage)
                 assocDefaultStorageGroupName = (
                     self.fast
                     .add_volume_to_default_storage_group_for_fast_policy(
@@ -1410,10 +1410,10 @@ class EMCVMAXMasking(object):
             ResultClass='Symm_FCSCSIProtocolEndpoint')
         numberOfPorts = len(targetPortInstanceNames)
         if numberOfPorts <= 0:
-            LOG.warn("No target ports found in "
-                     "masking view %(maskingView)s"
-                     % {'numPorts': len(targetPortInstanceNames),
-                        'maskingView': mvInstanceName})
+            LOG.warning(_LW("No target ports found in "
+                            "masking view %(maskingView)s"),
+                        {'numPorts': len(targetPortInstanceNames),
+                         'maskingView': mvInstanceName})
         for targetPortInstanceName in targetPortInstanceNames:
             targetWwns.append(targetPortInstanceName['Name'])
         return targetWwns
@@ -1456,5 +1456,5 @@ class EMCVMAXMasking(object):
                          'mv': maskingViewInstanceName})
             return portGroupInstanceNames[0]
         else:
-            LOG.warn("No port group found in masking view %(mv)s"
-                     % {'mv': maskingViewInstanceName})
+            LOG.warning(_LW("No port group found in masking view %(mv)s"),
+                        {'mv': maskingViewInstanceName})