From ce3eb674a77b74eeb409cf6fd87fb0e55acf77e3 Mon Sep 17 00:00:00 2001 From: Vitaly Gridnev Date: Mon, 18 Jan 2016 14:41:49 +0300 Subject: [PATCH] Use internal auth url to communicate with swift Use internal auth url to communicate with swift and make endpoint type overridable Change-Id: Ie482c006531bc1b31ee9ac380834b88d748b3557 Closes-bug: 1535105 --- sahara/swift/utils.py | 4 ++-- sahara/utils/openstack/swift.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sahara/swift/utils.py b/sahara/swift/utils.py index c185087325..095abde0ca 100644 --- a/sahara/swift/utils.py +++ b/sahara/swift/utils.py @@ -28,12 +28,12 @@ SWIFT_URL_SUFFIX_START = '.' SWIFT_URL_SUFFIX = SWIFT_URL_SUFFIX_START + 'sahara' -def retrieve_auth_url(): +def retrieve_auth_url(endpoint_type="publicURL"): """This function returns auth url v2.0 api. Hadoop Swift library doesn't support keystone v3 api. """ - auth_url = clients_base.retrieve_auth_url(endpoint_type="publicURL") + auth_url = clients_base.retrieve_auth_url(endpoint_type=endpoint_type) info = urlparse.urlparse(auth_url) if CONF.use_domain_for_proxy_users: diff --git a/sahara/utils/openstack/swift.py b/sahara/utils/openstack/swift.py index f8326583db..aa2cdb059e 100644 --- a/sahara/utils/openstack/swift.py +++ b/sahara/utils/openstack/swift.py @@ -66,7 +66,7 @@ def client(username, password, trust_id=None): auth_version='2.0', cacert=CONF.swift.ca_file, insecure=CONF.swift.api_insecure, - authurl=su.retrieve_auth_url(), + authurl=su.retrieve_auth_url(CONF.keystone.endpoint_type), user=username, key=password, tenant_name=sh.retrieve_tenant(),