]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixup regressions in PureISCSIDriver log statements.
authorPatrick East <patrick.east@purestorage.com>
Fri, 21 Nov 2014 16:39:45 +0000 (08:39 -0800)
committerPatrick East <patrick.east@purestorage.com>
Fri, 21 Nov 2014 16:39:45 +0000 (08:39 -0800)
There were some conflicting patches that went in to fix i18n helpers,
and in the merge resolution we lost some changes that previously removed
all uses of .format() from the driver. This puts back in the updated
log statements originally added in
https://review.openstack.org/#/c/135047/

Change-Id: I562a0dd950b88af2bdb67a135f6f6f0d258eed0e
Closes-Bug: 1395060

cinder/volume/drivers/pure.py

index 923b91e92c7c3ffdf7b0ebdbfe3dbedc4fd06243..0e9b2e9edee71e6bdeb4a916aa78be49031a6b93 100644 (file)
@@ -140,8 +140,8 @@ class PureISCSIDriver(san.SanISCSIDriver):
                 if err.kwargs["code"] == 400:
                     # Happens if the volume does not exist.
                     ctxt.reraise = False
-                    LOG.error(_LE("Volume deletion failed with message: {0}"
-                                  ).format(err.msg))
+                    LOG.error(_LE("Volume deletion failed with message: %s") %
+                              err.msg)
         LOG.debug("Leave PureISCSIDriver.delete_volume.")
 
     def create_snapshot(self, snapshot):
@@ -162,8 +162,8 @@ class PureISCSIDriver(san.SanISCSIDriver):
                 if err.kwargs["code"] == 400:
                     # Happens if the snapshot does not exist.
                     ctxt.reraise = False
-                    LOG.error(_LE("Snapshot deletion failed with message: {0}"
-                                  ).format(err.msg))
+                    LOG.error(_LE("Snapshot deletion failed with message:"
+                                  " %s") % err.msg)
         LOG.debug("Leave PureISCSIDriver.delete_snapshot.")
 
     def initialize_connection(self, volume, connector):
@@ -191,9 +191,11 @@ class PureISCSIDriver(san.SanISCSIDriver):
             self._run_iscsiadm_bare(["-m", "discovery", "-t", "sendtargets",
                                      "-p", self._iscsi_port["portal"]])
         except processutils.ProcessExecutionError as err:
-            LOG.warn(_LW("iSCSI discovery of port {0[name]} at {0[portal]} "
-                         "failed with error: {1}").format(self._iscsi_port,
-                                                          err.stderr))
+            LOG.warn(_LW("iSCSI discovery of port %(port_name)s at "
+                         "%(port_portal)s failed with error: %(err_msg)s") %
+                     {"port_name": self._iscsi_port["name"],
+                      "port_portal": self._iscsi_port["portal"],
+                      "err_msg": err.stderr})
             self._iscsi_port = self._choose_target_iscsi_port()
         return self._iscsi_port
 
@@ -270,7 +272,7 @@ class PureISCSIDriver(san.SanISCSIDriver):
                 self._array.delete_host(host_name)
         else:
             LOG.error(_LE("Unable to find host object in Purity with IQN: "
-                          "{iqn}.").format(iqn=connector["initiator"]))
+                          "%(iqn)s.") % {"iqn": connector["initiator"]})
         LOG.debug("Leave PureISCSIDriver.terminate_connection.")
 
     def get_volume_stats(self, refresh=False):