From d8143fe77be0544ed4f05ec02597dc979a60c66e Mon Sep 17 00:00:00 2001 From: Vipin Balachandran Date: Tue, 25 Aug 2015 14:36:51 +0530 Subject: [PATCH] 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 --- cinder/volume/drivers/vmware/exceptions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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.") -- 2.45.2