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:
parent
aa2c402e30
commit
6c309e2bc2
@ -135,8 +135,9 @@ class Auth(BaseAuth):
|
|||||||
|
|
||||||
if sum(mutual_exclusion) > 1:
|
if sum(mutual_exclusion) > 1:
|
||||||
raise exceptions.AuthorizationFailure(
|
raise exceptions.AuthorizationFailure(
|
||||||
'Authentication cannot be scoped to multiple targets. Pick '
|
message='Authentication cannot be scoped to multiple'
|
||||||
'one of: project, domain, trust or unscoped')
|
' targets. Pick one of: project, domain, '
|
||||||
|
'trust or unscoped')
|
||||||
|
|
||||||
if self.domain_id:
|
if self.domain_id:
|
||||||
body['auth']['scope'] = {'domain': {'id': self.domain_id}}
|
body['auth']['scope'] = {'domain': {'id': self.domain_id}}
|
||||||
|
Loading…
Reference in New Issue
Block a user