]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix error message in Pure driver with correct text
authorSimon Dodsley <simon@purestorage.com>
Tue, 7 Jul 2015 14:06:37 +0000 (10:06 -0400)
committerSimon Dodsley <simon@purestorage.com>
Tue, 7 Jul 2015 16:36:07 +0000 (12:36 -0400)
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

cinder/volume/drivers/pure.py

index 9babd0cba789b61328d54480093912aee0510576..913407191a0e808c3d6c1cbd9242f5c3b16abb08 100644 (file)
@@ -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})