summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--magnum/api/hooks.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/magnum/api/hooks.py b/magnum/api/hooks.py
index 8ad9c19..e0d36a9 100644
--- a/magnum/api/hooks.py
+++ b/magnum/api/hooks.py
@@ -16,7 +16,8 @@ from pecan import hooks
16 16
17from magnum.common import context 17from magnum.common import context
18from magnum.conductor import api as conductor_api 18from magnum.conductor import api as conductor_api
19import magnum.conf 19import magnum.conf.keystone
20
20 21
21CONF = magnum.conf.CONF 22CONF = magnum.conf.CONF
22 23
@@ -57,7 +58,11 @@ class ContextHook(hooks.PecanHook):
57 roles = headers.get('X-Roles', '').split(',') 58 roles = headers.get('X-Roles', '').split(',')
58 auth_token_info = state.request.environ.get('keystone.token_info') 59 auth_token_info = state.request.environ.get('keystone.token_info')
59 60
60 auth_url = CONF.keystone_authtoken.auth_uri 61 conf = CONF[magnum.conf.keystone.CFG_LEGACY_GROUP]
62 auth_url = (getattr(conf, 'www_authenticate_uri', None) or
63 getattr(conf, 'auth_uri', None))
64 if auth_url:
65 auth_url = auth_url.replace('v2.0', 'v3')
61 66
62 state.request.context = context.make_context( 67 state.request.context = context.make_context(
63 auth_token=auth_token, 68 auth_token=auth_token,