From 6c309e2bc222a0d1d645d5e33e36007651ea7f0e Mon Sep 17 00:00:00 2001 From: deepak_mourya Date: Tue, 30 Jan 2018 15:10:30 +0530 Subject: [PATCH] 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 --- keystoneauth1/identity/v3/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keystoneauth1/identity/v3/base.py b/keystoneauth1/identity/v3/base.py index d87c409c..06675ba7 100644 --- a/keystoneauth1/identity/v3/base.py +++ b/keystoneauth1/identity/v3/base.py @@ -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}}