summaryrefslogtreecommitdiff
path: root/keystoneclient/auth
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-05-20 23:10:10 +0000
committerGerrit Code Review <review@openstack.org>2015-05-20 23:10:10 +0000
commit841e634aceae0b483fb32f3cd9b8e3a99d662bad (patch)
treea7d610b2137dcfa09a03b65a43257967707fd341 /keystoneclient/auth
parente74f284243afe41a1f9f6c86ca61e86326db25c4 (diff)
parentfd16240be482b4841dfafeee404f3a8e2678333e (diff)
downloadpython-keystoneclient-841e634aceae0b483fb32f3cd9b8e3a99d662bad.tar.gz
Merge "Support discovery on the AUTH_INTERFACE"
Diffstat (limited to 'keystoneclient/auth')
-rw-r--r--keystoneclient/auth/identity/base.py41
1 files changed, 22 insertions, 19 deletions
diff --git a/keystoneclient/auth/identity/base.py b/keystoneclient/auth/identity/base.py
index 75c6d7f..8b8d705 100644
--- a/keystoneclient/auth/identity/base.py
+++ b/keystoneclient/auth/identity/base.py
@@ -198,26 +198,29 @@ class BaseIdentityPlugin(base.BaseAuthPlugin):
:rtype: string or None
"""
# NOTE(jamielennox): if you specifically ask for requests to be sent to
- # the auth url then we can ignore the rest of the checks. Typically if
- # you are asking for the auth endpoint it means that there is no
- # catalog to query anyway.
+ # the auth url then we can ignore many of the checks. Typically if you
+ # are asking for the auth endpoint it means that there is no catalog to
+ # query however we still need to support asking for a specific version
+ # of the auth_url for generic plugins.
if interface is base.AUTH_INTERFACE:
- return self.auth_url
-
- if not service_type:
- LOG.warn(_LW('Plugin cannot return an endpoint without knowing '
- 'the service type that is required. Add service_type '
- 'to endpoint filtering data.'))
- return None
-
- if not interface:
- interface = 'public'
-
- service_catalog = self.get_access(session).service_catalog
- url = service_catalog.url_for(service_type=service_type,
- endpoint_type=interface,
- region_name=region_name,
- service_name=service_name)
+ url = self.auth_url
+ service_type = service_type or 'identity'
+
+ else:
+ if not service_type:
+ LOG.warn(_LW('Plugin cannot return an endpoint without '
+ 'knowing the service type that is required. Add '
+ 'service_type to endpoint filtering data.'))
+ return None
+
+ if not interface:
+ interface = 'public'
+
+ service_catalog = self.get_access(session).service_catalog
+ url = service_catalog.url_for(service_type=service_type,
+ endpoint_type=interface,
+ region_name=region_name,
+ service_name=service_name)
if not version:
# NOTE(jamielennox): This may not be the best thing to default to