summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-03-13 01:23:45 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-13 01:23:45 +0000
commit8fe8ab2cc3b0814291cec3579aff267e042f4d6b (patch)
treeb0d10dd5bdbc5dfc4d7b11acb3a68d886a1d6422
parentc1e1a892905fe6898268056117405f4629f837fa (diff)
parent747e3c5f8a882b07b6876aae61c84d05a8b832f4 (diff)
Merge "Bugfix: yardstick https support"
-rw-r--r--yardstick/common/openstack_utils.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/yardstick/common/openstack_utils.py b/yardstick/common/openstack_utils.py
index aa369b896..2df8fa565 100644
--- a/yardstick/common/openstack_utils.py
+++ b/yardstick/common/openstack_utils.py
@@ -62,20 +62,6 @@ def get_credentials():
"project_domain_name": os.getenv('OS_PROJECT_DOMAIN_NAME')
})
- cacert = os.environ.get("OS_CACERT")
-
- if cacert is not None:
- # each openstack client uses differnt kwargs for this
- creds.update({"cacert": cacert,
- "ca_cert": cacert,
- "https_ca_cert": cacert,
- "https_cacert": cacert,
- "ca_file": cacert})
- creds.update({"insecure": "True", "https_insecure": "True"})
- if not os.path.isfile(cacert):
- log.info("WARNING: The 'OS_CACERT' environment variable is set \
- to %s but the file does not exist.", cacert)
-
return creds
@@ -88,7 +74,12 @@ def get_session_auth():
def get_session():
auth = get_session_auth()
- return session.Session(auth=auth)
+ try:
+ cacert = os.environ['OS_CACERT']
+ except KeyError:
+ return session.Session(auth=auth)
+ else:
+ return session.Session(auth=auth, verify=cacert)
def get_endpoint(service_type, endpoint_type='publicURL'):