From: Bridget McGinnis Date: Fri, 11 Sep 2015 04:35:05 +0000 (-0500) Subject: Fixed missing log variable types X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3cd8dd67d12f727f0fad51ed0d34c174e85ce01e;p=openstack-build%2Fcinder-build.git Fixed missing log variable types There were several cases of log messages that were missing string formatting types. This patch adds the missing types. Change-Id: If4336dafeb455cc1edd958219b1ffdd50bb2ca05 Closes-Bug: #1494574 --- diff --git a/cinder/consistencygroup/api.py b/cinder/consistencygroup/api.py index 7ca334422..77d1d7f7c 100644 --- a/cinder/consistencygroup/api.py +++ b/cinder/consistencygroup/api.py @@ -170,7 +170,7 @@ class API(base.Base): cgsnapshot = self.db.cgsnapshot_get(context, cgsnapshot_id) except exception.CgSnapshotNotFound: with excutils.save_and_reraise_exception(): - LOG.error(_LE("CG snapshot %(cgsnap) not found when " + LOG.error(_LE("CG snapshot %(cgsnap)s not found when " "creating consistency group %(cg)s from " "source."), {'cg': name, 'cgsnap': cgsnapshot_id}) @@ -184,7 +184,7 @@ class API(base.Base): source_cgid) except exception.ConsistencyGroupNotFound: with excutils.save_and_reraise_exception(): - LOG.error(_LE("Source CG %(source_cg) not found when " + LOG.error(_LE("Source CG %(source_cg)s not found when " "creating consistency group %(cg)s from " "source."), {'cg': name, 'source_cg': source_cgid}) diff --git a/cinder/volume/drivers/emc/emc_vmax_masking.py b/cinder/volume/drivers/emc/emc_vmax_masking.py index 18efe241d..710738233 100644 --- a/cinder/volume/drivers/emc/emc_vmax_masking.py +++ b/cinder/volume/drivers/emc/emc_vmax_masking.py @@ -2051,9 +2051,9 @@ class EMCVMAXMasking(object): sgInstanceName)) else: errorMessage = (_( - "Storage group %(sgGroupName) " + "Storage group %(sgGroupName)s " "does not exist.") - % {'StorageGroup': defaultStorageGroupName}) + % {'sgGroupName': defaultStorageGroupName}) LOG.error(errorMessage) raise exception.VolumeBackendAPIException( data=errorMessage) diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index 95d370ef0..b16624c5b 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -1674,7 +1674,7 @@ class CommandLineHelper(object): # When active sp is unavailable, switch to another sp # and set it to active and force a poll if self._toggle_sp(): - LOG.debug('EMC: Command Exception: %(rc) %(result)s. ' + LOG.debug('EMC: Command Exception: %(rc)s %(result)s. ' 'Retry on another SP.', {'rc': rc, 'result': out}) kwargv['poll'] = True @@ -2199,7 +2199,7 @@ class EMCVnxCliBase(object): if len(target_pool_name) == 0: # Destination host is using a legacy driver LOG.warning(_LW("Didn't get the pool information of the " - "host %(s). Storage assisted Migration is not " + "host %s. Storage assisted Migration is not " "supported. The host may be using a legacy " "driver."), host['name']) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index a4abc448f..98afbcbc8 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -443,10 +443,10 @@ class HP3PARCommon(object): LOG.warning(err) except hpexceptions.HTTPConflict as e: err = (_LE("Conflict detected in Virtual Volume Set" - " %(volume_set): %(error)"), - {"volume_set": cg_name, - "error": e}) - LOG.error(err) + " %(volume_set)s: %(error)s")) + LOG.error(err, + {"volume_set": cg_name, + "error": e}) volumes = self.db.volume_get_all_by_group(context, group.id) for volume in volumes: diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 0587c189c..ed8f99ada 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -1048,7 +1048,7 @@ class VolumeManager(manager.SchedulerDependentManager): image_meta) if not image_volume: LOG.warning(_LW('Unable to clone image_volume for image ' - '%(image_id) will not create cache entry.'), + '%(image_id)s will not create cache entry.'), {'image_id': image_id}) return @@ -1107,7 +1107,7 @@ class VolumeManager(manager.SchedulerDependentManager): return image_volume except exception.CinderException: LOG.exception(_LE('Failed to clone volume %(volume_id)s for ' - 'image %(image_id).'), + 'image %(image_id)s.'), {'volume_id': volume.id, 'image_id': image_meta['id']}) try: @@ -1320,7 +1320,7 @@ class VolumeManager(manager.SchedulerDependentManager): raise exception.InvalidInput(reason=six.text_type(err)) except Exception as err: err_msg = (_("Validate volume connection failed " - "(error: %(err)).") % {'err': six.text_type(err)}) + "(error: %(err)s).") % {'err': six.text_type(err)}) LOG.error(err_msg, resource=volume) raise exception.VolumeBackendAPIException(data=err_msg) diff --git a/cinder/volume/targets/cxt.py b/cinder/volume/targets/cxt.py index 3d1fc0289..8ab161a70 100644 --- a/cinder/volume/targets/cxt.py +++ b/cinder/volume/targets/cxt.py @@ -206,7 +206,7 @@ class CxtAdm(iscsi.ISCSITarget): if tid is None: LOG.error(_LE("Failed to create iscsi target for volume " "id:%(vol_id)s. Please verify your configuration " - "in %(volumes_dir)'"), { + "in %(volumes_dir)s'"), { 'vol_id': vol_id, 'volumes_dir': volumes_dir, }) raise exception.NotFound()