diff options
author | 2017-05-25 08:51:48 +0000 | |
---|---|---|
committer | 2017-06-21 09:04:14 +0000 | |
commit | 7140b86629af0958358be5628895c4b5f1fd1ea4 (patch) | |
tree | d110974d4ff45dd7374dfde2950a611193a5bbe2 /functest/utils/openstack_utils.py | |
parent | a48bf0c8306e566f15877f3bd72882cf8b7663db (diff) |
Enable https insecure for functest
1. When running in https environment, functest should provide an
option to disable server certificate verification.
2. For check_os.sh, the param "--insecure" is passed to openstack
cli, e.g.. openstack --insecure server list.
JIRA: FUNCTEST-828
Change-Id: Ie2c5b14152c92e87318fcfaf8b234f59275eb6b8
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/utils/openstack_utils.py')
-rw-r--r-- | functest/utils/openstack_utils.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py index 57a2aa2b..cc62f29c 100644 --- a/functest/utils/openstack_utils.py +++ b/functest/utils/openstack_utils.py @@ -181,14 +181,10 @@ def get_endpoint(service_type, endpoint_type='publicURL'): def get_session(other_creds={}): auth = get_session_auth(other_creds) - cacert = os.getenv('OS_CACERT') - if cacert is not None: - if not os.path.isfile(cacert): - raise Exception("The 'OS_CACERT' environment" - "variable is set to %s but the file" - "does not exist.", cacert) - - return session.Session(auth=auth, verify=cacert) + https_cacert = os.getenv('OS_CACERT', '') + https_insecure = os.getenv('OS_INSECURE', '').lower() == 'true' + return session.Session(auth=auth, + verify=(https_cacert or not https_insecure)) # ********************************************* |