summaryrefslogtreecommitdiff
path: root/nova/network/neutron.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/network/neutron.py')
-rw-r--r--nova/network/neutron.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/nova/network/neutron.py b/nova/network/neutron.py
index 5b68d5ab10..0385b2ffbd 100644
--- a/nova/network/neutron.py
+++ b/nova/network/neutron.py
@@ -209,13 +209,15 @@ def _get_auth_plugin(context, admin=False):
# support some services (metadata API) where an admin context is used
# without an auth token.
global _ADMIN_AUTH
+ user_auth = None
if admin or (context.is_admin and not context.auth_token):
if not _ADMIN_AUTH:
_ADMIN_AUTH = _load_auth_plugin(CONF)
- return _ADMIN_AUTH
+ user_auth = _ADMIN_AUTH
- if context.auth_token:
- return service_auth.get_auth_plugin(context)
+ if context.auth_token or user_auth:
+ # When user_auth = None, user_auth will be extracted from the context.
+ return service_auth.get_auth_plugin(context, user_auth=user_auth)
# We did not get a user token and we should not be using
# an admin token so log an error