summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rwxr-xr-xutils/infra_setup/heat/common.py23
-rw-r--r--utils/parser.py10
2 files changed, 16 insertions, 17 deletions
diff --git a/utils/infra_setup/heat/common.py b/utils/infra_setup/heat/common.py
index ab0dadf5..a0d6d83c 100755
--- a/utils/infra_setup/heat/common.py
+++ b/utils/infra_setup/heat/common.py
@@ -54,20 +54,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
@@ -80,7 +66,14 @@ 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:
+ insecure = os.getenv('OS_INSECURE', '').lower() == 'true'
+ cacert = False if insecure else cacert
+ return session.Session(auth=auth, verify=cacert)
def get_endpoint(service_type, endpoint_type='publicURL'):
diff --git a/utils/parser.py b/utils/parser.py
index 65072c06..f130de44 100644
--- a/utils/parser.py
+++ b/utils/parser.py
@@ -83,8 +83,14 @@ class Parser():
@classmethod
def testcase_out_dir(cls, testcase):
- file_time = time.strftime('%H_%M', time.localtime(time.time()))
- out_name = cls.bottlenecks_config["log_dir"] + testcase + file_time
+ suffix_name = os.getenv("SUFFIX_STRING")
+ if suffix_name is None:
+ file_suffix = time.strftime('%H_%M', time.localtime(time.time()))
+ else:
+ file_suffix = suffix_name
+ suffix_name = str(suffix_name)
+ suffix_name = "_" + suffix_name
+ out_name = cls.bottlenecks_config["log_dir"] + testcase + file_suffix
outfile_name = out_name + ".out"
return outfile_name