From: Vipin Balachandran Date: Tue, 25 Aug 2015 09:06:51 +0000 (+0530) Subject: VMware: Fix exception messages X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d8143fe77be0544ed4f05ec02597dc979a60c66e;p=openstack-build%2Fcinder-build.git VMware: Fix exception messages Currently some of the exceptions defined in the VMware driver emit unformatted error messages. This is because they are not overriding the correct message format variable. This patch fixes the issue by overriding the correct variable defined in the exception super class. Closes-Bug: #1491834 Change-Id: I1c66d60ab2ea402dd944587b3d8b6d7c293c4d85 --- diff --git a/cinder/volume/drivers/vmware/exceptions.py b/cinder/volume/drivers/vmware/exceptions.py index 2fa3209fa..5917b1df0 100644 --- a/cinder/volume/drivers/vmware/exceptions.py +++ b/cinder/volume/drivers/vmware/exceptions.py @@ -44,14 +44,14 @@ class ProfileNotFoundException(exceptions.VMwareDriverException): class NoValidDatastoreException(exceptions.VMwareDriverException): """Thrown when there are no valid datastores.""" - message = _("There are no valid datastores.") + msg_fmt = _("There are no valid datastores.") class ClusterNotFoundException(exceptions.VMwareDriverException): """Thrown when the given cluster cannot be found.""" - message = _("Compute cluster: %(cluster)s not found.") + msg_fmt = _("Compute cluster: %(cluster)s not found.") class NoValidHostException(exceptions.VMwareDriverException): """Thrown when there are no valid ESX hosts.""" - message = _("There are no valid ESX hosts.") + msg_fmt = _("There are no valid ESX hosts.")