Browse Source

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

Change-Id: Ia3f39a0362259429f4d2d995e94073a993ae48a7
Closes-Bug: #1666790
(cherry picked from commit 44b83d3b14)
yatinkarel 2 years ago
parent
commit
1a685113d8
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      magnum/common/keystone.py

+ 10
- 5
magnum/common/keystone.py View File

@@ -93,9 +93,11 @@ class KeystoneClientV3(object):
93 93
             auth = ka_v3.Password(**auth_info)
94 94
 
95 95
         else:
96
-            LOG.error(_LE('Keystone API connection failed: no password, '
97
-                          'trust_id or token found.'))
98
-            raise exception.AuthorizationFailure()
96
+            msg = _LE('Keystone API connection failed: no password, '
97
+                      'trust_id or token found.')
98
+            LOG.error(msg)
99
+            raise exception.AuthorizationFailure(client='keystone',
100
+                                                 message='reason %s' % msg)
99 101
 
100 102
         return auth
101 103
 
@@ -181,8 +183,11 @@ class KeystoneClientV3(object):
181 183
                     self.domain_admin_session
182 184
                 )
183 185
             except kc_exception.Unauthorized:
184
-                LOG.error(_LE("Keystone client authentication failed"))
185
-                raise exception.AuthorizationFailure()
186
+                msg = _LE("Keystone client authentication failed")
187
+                LOG.error(msg)
188
+                raise exception.AuthorizationFailure(client='keystone',
189
+                                                     message='reason: %s' %
190
+                                                             msg)
186 191
 
187 192
             self._trustee_domain_id = access.domain_id
188 193
 

Loading…
Cancel
Save