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
This commit is contained in:
Vitaly Gridnev 2016-01-18 14:41:49 +03:00
parent aef8c4206c
commit ce3eb674a7
2 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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(),