From 8d29321d2505590e4d6f649933d95ad895dd8c54 Mon Sep 17 00:00:00 2001 From: Patrick East Date: Fri, 21 Nov 2014 08:39:45 -0800 Subject: [PATCH] Fixup regressions in PureISCSIDriver log statements. 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 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 923b91e92..0e9b2e9ed 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -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): -- 2.45.2