From 44b83d3b142e84b14c5fda3ede76e6210a22b422 Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Wed, 22 Feb 2017 12:32:41 +0530 Subject: [PATCH] Pass 'client', 'message' param to AuthorizationFailure Exception Change-Id: Ia3f39a0362259429f4d2d995e94073a993ae48a7 Closes-Bug: #1666790 --- magnum/common/keystone.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/magnum/common/keystone.py b/magnum/common/keystone.py index 711318578a..28557ef13a 100644 --- a/magnum/common/keystone.py +++ b/magnum/common/keystone.py @@ -93,9 +93,11 @@ class KeystoneClientV3(object): auth = ka_v3.Password(**auth_info) else: - LOG.error(_LE('Keystone API connection failed: no password, ' - 'trust_id or token found.')) - raise exception.AuthorizationFailure() + msg = _LE('Keystone API connection failed: no password, ' + 'trust_id or token found.') + LOG.error(msg) + raise exception.AuthorizationFailure(client='keystone', + message='reason %s' % msg) return auth @@ -181,8 +183,11 @@ class KeystoneClientV3(object): self.domain_admin_session ) except kc_exception.Unauthorized: - LOG.error(_LE("Keystone client authentication failed")) - raise exception.AuthorizationFailure() + msg = _LE("Keystone client authentication failed") + LOG.error(msg) + raise exception.AuthorizationFailure(client='keystone', + message='reason: %s' % + msg) self._trustee_domain_id = access.domain_id