summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lazarev <alazarev@mirantis.com>2015-02-10 16:01:22 -0800
committerAndrew Lazarev <alazarev@mirantis.com>2015-02-10 16:01:22 -0800
commita251dc4c7ac7d5771dd73d3b2653d0ef0f6646e4 (patch)
tree7156894377879838b0f6d1e9d1fcbfa5ce71ef2c
parent18fc6a4905dc975a016b1e33eaecf6b9e759c530 (diff)
downloadpython-saharaclient-a251dc4c7ac7d5771dd73d3b2653d0ef0f6646e4.tar.gz
Added --bypass-url support for keystone 3
Keystone 3 section of code should respect --bypass-url too. Change-Id: I88175247e7c9bef6662074bcc38f85392d4fcac3 Closes-Bug: #1420551
-rw-r--r--saharaclient/api/client.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/saharaclient/api/client.py b/saharaclient/api/client.py
index 4ba1e97..bd20697 100644
--- a/saharaclient/api/client.py
+++ b/saharaclient/api/client.py
@@ -54,17 +54,18 @@ class Client(object):
service_name=service_name,
region_name=region_name)
input_auth_token = keystone.session.get_token(auth)
- try:
- sahara_catalog_url = keystone.session.get_endpoint(
- auth, interface=endpoint_type,
- service_type=service_type)
- except kex.EndpointNotFound:
- # This is support of 'data_processing' service spelling
- # which was used for releases before Kilo
- service_type = service_type.replace('-', '_')
- sahara_catalog_url = keystone.session.get_endpoint(
- auth, interface=endpoint_type,
- service_type=service_type)
+ if not sahara_catalog_url:
+ try:
+ sahara_catalog_url = keystone.session.get_endpoint(
+ auth, interface=endpoint_type,
+ service_type=service_type)
+ except kex.EndpointNotFound:
+ # This is support of 'data_processing' service spelling
+ # which was used for releases before Kilo
+ service_type = service_type.replace('-', '_')
+ sahara_catalog_url = keystone.session.get_endpoint(
+ auth, interface=endpoint_type,
+ service_type=service_type)
else:
keystone = self.get_keystone_client(
username=username,