diff options
author | Linda Wang <wangwulin@huawei.com> | 2017-06-20 06:31:29 +0000 |
---|---|---|
committer | Linda Wang <wangwulin@huawei.com> | 2017-06-22 16:24:59 +0000 |
commit | dbfb9c4e94e500592a8b93f42b7b87230d0af311 (patch) | |
tree | e8c15131bdca7e7c52abe93f641c366e4d6934cb /snaps/openstack/tests/openstack_tests.py | |
parent | 39b46e7e43dffff8f4abfbc142c9e28c9ce0d260 (diff) |
Enable https for Openstack in Snaps
When running in https environment, snaps should provide two options:
1. To support certification verify when https certification file is provided;
2. To disable server certificate verification without cert file.
JIRA: SNAPS-84
Change-Id: I5a9094238db5c8017cc8b80e3353adc6e793b552
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'snaps/openstack/tests/openstack_tests.py')
-rw-r--r-- | snaps/openstack/tests/openstack_tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/snaps/openstack/tests/openstack_tests.py b/snaps/openstack/tests/openstack_tests.py index bfcadaf..109d2ce 100644 --- a/snaps/openstack/tests/openstack_tests.py +++ b/snaps/openstack/tests/openstack_tests.py @@ -85,6 +85,13 @@ def get_credentials(os_env_file=None, proxy_settings_str=None, tokens = re.split(':', proxy_settings_str) proxy_settings = ProxySettings(tokens[0], tokens[1], ssh_proxy_cmd) + if config.get('OS_CACERT'): + https_cacert = config.get('OS_CACERT') + elif config.get('OS_INSECURE'): + https_cacert = False + else: + https_cacert = True + os_creds = OSCreds(username=config['OS_USERNAME'], password=config['OS_PASSWORD'], auth_url=config['OS_AUTH_URL'], @@ -92,7 +99,8 @@ def get_credentials(os_env_file=None, proxy_settings_str=None, identity_api_version=version, user_domain_id=user_domain_id, project_domain_id=proj_domain_id, - proxy_settings=proxy_settings) + proxy_settings=proxy_settings, + cacert=https_cacert) else: logger.info('Reading development os_env file - ' + dev_os_env_file) config = file_utils.read_yaml(dev_os_env_file) |