Override support message in AuthorizationFailure class

AuthorizationFailure exception class should support
message override

class AuthorizationFailure(base.ClientException):
    message = "Cannot authorize API client."

Users will only be able to see the above message
"Cannot authorize API client." which is less useful to debug.

Change-Id: I27ac6ebfb68ba3edad08a5c97b91f4abab9b395f
Closes-Bug: #1745930
This commit is contained in:
deepak_mourya 2018-01-30 15:10:30 +05:30
parent aa2c402e30
commit 6c309e2bc2

View File

@ -135,8 +135,9 @@ class Auth(BaseAuth):
if sum(mutual_exclusion) > 1:
raise exceptions.AuthorizationFailure(
'Authentication cannot be scoped to multiple targets. Pick '
'one of: project, domain, trust or unscoped')
message='Authentication cannot be scoped to multiple'
' targets. Pick one of: project, domain, '
'trust or unscoped')
if self.domain_id:
body['auth']['scope'] = {'domain': {'id': self.domain_id}}