summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>2018-07-28 00:28:47 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-07-28 00:28:47 +0000
commitb252cd9f78d00ba52ab79f5ff8f7b7d5abea7c7e (patch)
tree55fde6c4a03c6e51760ec831cfa625930f65ea73
parent07b553641c1f5991191eb4efcb238cd819f7f6a8 (diff)
parent2822554647c906a1bdaa0b1661cbd8416e2fd7ef (diff)
Merge "bug-fix: insecure option for quota setting"
-rwxr-xr-xutils/infra_setup/heat/common.py16
1 files changed, 9 insertions, 7 deletions
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'):