From: Simon Dodsley Date: Tue, 7 Jul 2015 14:06:37 +0000 (-0400) Subject: Fix error message in Pure driver with correct text X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2c3fed3925c1fe530ec57e88e3041f9742412381;p=openstack-build%2Fcinder-build.git Fix error message in Pure driver with correct text The error message was specifically mentioning the PureISCSIDriver but now there is a PureFCDriver which could call the error message. This change gets the name of the driver and uses that to ensure the error message refers to the correct driver. Closes-Bug: #1469523 Change-Id: Ib724073ea352dadfbe7ddcf4ee4ceedd5d2c7c41 --- diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 9babd0cba..913407191 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -481,10 +481,10 @@ class PureBaseVolumeDriver(san.SanDriver): if len(connected_hosts) > 0: raise exception.ManageExistingInvalidReference( existing_ref=existing_ref, - reason=_("PureISCSIDriver manage_existing cannot manage a " - "volume connected to hosts. Please disconnect the " - "volume from existing hosts before importing.")) - + reason=_("%(driver)s manage_existing cannot manage a volume " + "connected to hosts. Please disconnect this volume " + "from existing hosts before importing" + ) % {'driver': self.__class__.__name__}) new_vol_name = self._get_vol_name(volume) LOG.info(_LI("Renaming existing volume %(ref_name)s to %(new_name)s"), {"ref_name": ref_vol_name, "new_name": new_vol_name})