From: Yu Yang (Gabriel) Date: Sat, 28 Jul 2018 00:28:47 +0000 (+0000) Subject: Merge "bug-fix: insecure option for quota setting" X-Git-Tag: opnfv-7.1.0~20 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=b252cd9f78d00ba52ab79f5ff8f7b7d5abea7c7e;hp=07b553641c1f5991191eb4efcb238cd819f7f6a8;p=bottlenecks.git Merge "bug-fix: insecure option for quota setting" --- diff --git a/utils/infra_setup/heat/common.py b/utils/infra_setup/heat/common.py index a0d6d83c..f0512b0f 100755 --- a/utils/infra_setup/heat/common.py +++ b/utils/infra_setup/heat/common.py @@ -66,14 +66,16 @@ def get_session_auth(): def get_session(): auth = get_session_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 + if os.getenv('OS_INSECURE', '').lower() == 'true': + cacert = False return session.Session(auth=auth, verify=cacert) + else: + 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'):