From: KIYOHIRO ADACHI Date: Tue, 11 Mar 2014 01:17:32 +0000 (+0900) Subject: Fix exception message of CoraidESMConfigureError X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=657b5106c35e2834d75e77e4702b9fd99bde817f;p=openstack-build%2Fcinder-build.git Fix exception message of CoraidESMConfigureError Since 'message' is the same name as the second argument to the constructor of CinderException, 'message="Oorah"' is not a keyword argument. Therefore, "message = _('ESM configure request failed: %(message)s.')" doesn't work correctly. Then, remove the redundant period. Change-Id: Iafc457197fc3993f9f942babcdda0cd79b7bd518 Closes-Bug: #1290627 --- diff --git a/cinder/exception.py b/cinder/exception.py index 8ef9c7cb6..dc7407be3 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -594,11 +594,11 @@ class CoraidESMBadGroup(CoraidException): class CoraidESMConfigureError(CoraidException): - message = _('ESM configure request failed: %(message)s.') + message = _('ESM configure request failed: %(reason)s') class CoraidESMNotAvailable(CoraidException): - message = _('Coraid ESM not available with reason: %(reason)s.') + message = _('Coraid ESM not available with reason: %(reason)s') # Zadara diff --git a/cinder/volume/drivers/coraid.py b/cinder/volume/drivers/coraid.py index a7e309d93..be162f945 100644 --- a/cinder/volume/drivers/coraid.py +++ b/cinder/volume/drivers/coraid.py @@ -241,10 +241,10 @@ class CoraidAppliance(object): if self._is_bad_config_state(reply): # Calculate error message if not reply: - message = _('Reply is empty.') + reason = _('Reply is empty.') else: - message = reply.get('message', _('Error message is empty.')) - raise exception.CoraidESMConfigureError(message=message) + reason = reply.get('message', _('Error message is empty.')) + raise exception.CoraidESMConfigureError(reason=reason) return reply def esm_command(self, request):