From 6a2ee8883daf1795ec84fc2868c17c0723025447 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Fri, 15 Dec 2017 02:57:26 +0000 Subject: Inject all envs in openrc into CONST After "env_prepare" is removed, some specific vars in openrc (eg,."EXTERNAL_NETWORK") loaded to os.environ should be injected into CONST in one python process. Change-Id: Iaa5c6047033dc2a30c533174e2016111759aec31 Signed-off-by: Linda Wang --- functest/ci/run_tests.py | 13 ------------- functest/utils/openstack_utils.py | 1 + 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index b8da3be6..c8143f1e 100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -19,7 +19,6 @@ import sys import textwrap import prettytable -import six import functest.ci.tier_builder as tb import functest.core.testcase as testcase @@ -86,18 +85,6 @@ class Runner(object): raise Exception("RC file %s does not exist..." % rc_file) logger.debug("Sourcing the OpenStack RC file...") os_utils.source_credentials(rc_file) - for key, value in six.iteritems(os.environ): - if re.search("OS_", key): - if key == 'OS_AUTH_URL': - CONST.__setattr__('OS_AUTH_URL', value) - elif key == 'OS_USERNAME': - CONST.__setattr__('OS_USERNAME', value) - elif key == 'OS_TENANT_NAME': - CONST.__setattr__('OS_TENANT_NAME', value) - elif key == 'OS_PASSWORD': - CONST.__setattr__('OS_PASSWORD', value) - elif key == "OS_PROJECT_DOMAIN_NAME": - CONST.__setattr__('OS_PROJECT_DOMAIN_NAME', value) @staticmethod def get_run_dict(testname): diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py index b479198d..1d7cdafb 100644 --- a/functest/utils/openstack_utils.py +++ b/functest/utils/openstack_utils.py @@ -127,6 +127,7 @@ def source_credentials(rc_file): key = re.sub(r'^["\' ]*|[ \'"]*$', '', var[0]) value = re.sub(r'^["\' ]*|[ \'"]*$', '', "".join(var[1:])) os.environ[key] = value + CONST.__setattr__(key, value) def get_session_auth(other_creds={}): -- cgit 1.2.3-korg