Fix missing ca-certificate parameter to get_auth.
Missing cacert parameter in get_auth_1_0() and it makes requests_args['verify'] is True in default(likes "swift --os-cacert ssl.crti list"). The requests_args['verify'] should be a ca-certificate file name("ssl.crt"). Change-Id: Id3110f3818f55922ad19eeb1ead80fface824009 Closes-Bug: 1418473
This commit is contained in:
parent
06c73c6020
commit
df2442166c
@ -247,8 +247,9 @@ def http_connection(*arg, **kwarg):
|
|||||||
|
|
||||||
|
|
||||||
def get_auth_1_0(url, user, key, snet, **kwargs):
|
def get_auth_1_0(url, user, key, snet, **kwargs):
|
||||||
|
cacert = kwargs.get('cacert', None)
|
||||||
insecure = kwargs.get('insecure', False)
|
insecure = kwargs.get('insecure', False)
|
||||||
parsed, conn = http_connection(url, insecure=insecure)
|
parsed, conn = http_connection(url, cacert=cacert, insecure=insecure)
|
||||||
method = 'GET'
|
method = 'GET'
|
||||||
conn.request(method, parsed.path, '',
|
conn.request(method, parsed.path, '',
|
||||||
{'X-Auth-User': user, 'X-Auth-Key': key})
|
{'X-Auth-User': user, 'X-Auth-Key': key})
|
||||||
@ -374,12 +375,14 @@ def get_auth(auth_url, user, key, **kwargs):
|
|||||||
os_options = kwargs.get('os_options', {})
|
os_options = kwargs.get('os_options', {})
|
||||||
|
|
||||||
storage_url, token = None, None
|
storage_url, token = None, None
|
||||||
|
cacert = kwargs.get('cacert', None)
|
||||||
insecure = kwargs.get('insecure', False)
|
insecure = kwargs.get('insecure', False)
|
||||||
if auth_version in AUTH_VERSIONS_V1:
|
if auth_version in AUTH_VERSIONS_V1:
|
||||||
storage_url, token = get_auth_1_0(auth_url,
|
storage_url, token = get_auth_1_0(auth_url,
|
||||||
user,
|
user,
|
||||||
key,
|
key,
|
||||||
kwargs.get('snet'),
|
kwargs.get('snet'),
|
||||||
|
cacert=cacert,
|
||||||
insecure=insecure)
|
insecure=insecure)
|
||||||
elif auth_version in AUTH_VERSIONS_V2 + AUTH_VERSIONS_V3:
|
elif auth_version in AUTH_VERSIONS_V2 + AUTH_VERSIONS_V3:
|
||||||
# We are handling a special use case here where the user argument
|
# We are handling a special use case here where the user argument
|
||||||
@ -400,7 +403,6 @@ def get_auth(auth_url, user, key, **kwargs):
|
|||||||
raise ClientException('No tenant specified')
|
raise ClientException('No tenant specified')
|
||||||
raise ClientException('No project name or project id specified.')
|
raise ClientException('No project name or project id specified.')
|
||||||
|
|
||||||
cacert = kwargs.get('cacert', None)
|
|
||||||
storage_url, token = get_auth_keystone(auth_url, user,
|
storage_url, token = get_auth_keystone(auth_url, user,
|
||||||
key, os_options,
|
key, os_options,
|
||||||
cacert=cacert,
|
cacert=cacert,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user