Pass 'client', 'message' param to AuthorizationFailure Exception

Change-Id: Ia3f39a0362259429f4d2d995e94073a993ae48a7
Closes-Bug: #1666790
(cherry picked from commit 44b83d3b14)
This commit is contained in:
yatinkarel 2017-02-22 12:32:41 +05:30 committed by Mark Goddard
parent 73f4d639c5
commit 1a685113d8
1 changed files with 10 additions and 5 deletions

View File

@ -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