From 42a5c8eeae1821ffebbf29ce779f73f47b7e7897 Mon Sep 17 00:00:00 2001 From: xianming mao Date: Thu, 8 Sep 2016 14:58:59 +0800 Subject: [PATCH] fix the %{} when string formating use %() instead of %{} when string formating Closes-Bug #1622289 Change-Id: I1bd15c03cf3df9e1ec16a518383407eff5594f56 --- cinder/volume/drivers/violin/v7000_common.py | 4 ++-- cinder/volume/targets/cxt.py | 2 +- cinder/volume/targets/tgt.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cinder/volume/drivers/violin/v7000_common.py b/cinder/volume/drivers/violin/v7000_common.py index 048b61814a5..7a237c690e0 100644 --- a/cinder/volume/drivers/violin/v7000_common.py +++ b/cinder/volume/drivers/violin/v7000_common.py @@ -781,7 +781,7 @@ class V7000Common(object): raise loopingcall.LoopingCallDone(retvalue=True) elif mb_copied is not None: # copy is in progress - LOG.debug("MB copied: %{copied}d, percent done: %{percent}d.", + LOG.debug("MB copied: %(copied)d, percent done: %(percent)d.", {'copied': mb_copied, 'percent': percent}) pass elif percent == 0: @@ -794,7 +794,7 @@ class V7000Common(object): raise loopingcall.LoopingCallDone(retvalue=True) else: # unexpected case - LOG.debug("unexpected case (%{id}s, %{bytes}s, %{percent}s)", + LOG.debug("unexpected case (%(id)s, %(bytes)s, %(percent)s)", {'id': target_id, 'bytes': mb_copied, 'percent': six.text_type(percent)}) diff --git a/cinder/volume/targets/cxt.py b/cinder/volume/targets/cxt.py index d129f5f38c8..ad3b7fe5468 100644 --- a/cinder/volume/targets/cxt.py +++ b/cinder/volume/targets/cxt.py @@ -139,7 +139,7 @@ class CxtAdm(iscsi.ISCSITarget): old_name = kwargs.get('old_name', None) if old_name: LOG.debug('Detected old persistence file for volume ' - '%{vol}s at %{old_name}s', + '%(vol)s at %(old_name)s', {'vol': vol_id, 'old_name': old_name}) old_persist_file = os.path.join(volumes_dir, old_name) diff --git a/cinder/volume/targets/tgt.py b/cinder/volume/targets/tgt.py index e7f7377a1d2..95014138056 100644 --- a/cinder/volume/targets/tgt.py +++ b/cinder/volume/targets/tgt.py @@ -171,7 +171,7 @@ class TgtAdm(iscsi.ISCSITarget): old_name = kwargs.get('old_name', None) if old_name is not None: LOG.debug('Detected old persistence file for volume ' - '%{vol}s at %{old_name}s', + '%(vol)s at %(old_name)s', {'vol': vol_id, 'old_name': old_name}) old_persist_file = os.path.join(volumes_dir, old_name)