From 7140b86629af0958358be5628895c4b5f1fd1ea4 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Thu, 25 May 2017 08:51:48 +0000 Subject: 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 --- functest/utils/openstack_utils.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'functest/utils') 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)) # ********************************************* -- cgit 1.2.3-korg