From 8f0134178d24b7b478beb22395c448cf76e381f2 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Tue, 5 Dec 2017 10:20:55 +0000 Subject: All patching config files in memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It adds the yaml content as Config attribute and allow patching it without modifying the file (and reimport constants or config). It also removes obsolete data in config_patch.yaml and moves several functions in the right modules (Config) JIRA: ARMBAND-334 Co-Authored-By: Cédric Ollivier Change-Id: I5c9a574d3283828063154c977cdfbc2abfdc6777 Signed-off-by: Linda Wang Signed-off-by: Cédric Ollivier --- functest/ci/run_tests.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'functest/ci/run_tests.py') diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 67a6f142..b8da3be6 100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -20,7 +20,6 @@ import textwrap import prettytable import six -import yaml import functest.ci.tier_builder as tb import functest.core.testcase as testcase @@ -33,13 +32,6 @@ logger = logging.getLogger('functest.ci.run_tests') CONFIG_FUNCTEST_PATH = pkg_resources.resource_filename( 'functest', 'ci/config_functest.yaml') -CONFIG_PATCH_PATH = pkg_resources.resource_filename( - 'functest', 'ci/config_patch.yaml') -CONFIG_AARCH64_PATCH_PATH = pkg_resources.resource_filename( - 'functest', 'ci/config_aarch64_patch.yaml') -# set the architecture to default -pod_arch = os.getenv("POD_ARCH", None) -arch_filter = ['aarch64'] class Result(enum.Enum): @@ -87,31 +79,6 @@ class Runner(object): CONST.__getattribute__('DEPLOY_SCENARIO'), pkg_resources.resource_filename('functest', 'ci/testcases.yaml')) - @staticmethod - def update_config_file(): - Runner.patch_file(CONFIG_PATCH_PATH) - - if pod_arch and pod_arch in arch_filter: - Runner.patch_file(CONFIG_AARCH64_PATCH_PATH) - - @staticmethod - def patch_file(patch_file_path): - logger.debug('Updating file: %s', patch_file_path) - with open(patch_file_path) as f: - patch_file = yaml.safe_load(f) - - updated = False - for key in patch_file: - if key in CONST.__getattribute__('DEPLOY_SCENARIO'): - new_functest_yaml = dict(ft_utils.merge_dicts( - ft_utils.get_functest_yaml(), patch_file[key])) - updated = True - - if updated: - os.remove(CONFIG_FUNCTEST_PATH) - with open(CONFIG_FUNCTEST_PATH, "w") as f: - f.write(yaml.dump(new_functest_yaml, default_style='"')) - @staticmethod def source_rc_file(): rc_file = CONST.__getattribute__('openstack_creds') @@ -229,8 +196,6 @@ class Runner(object): self.run_tier(tier) def main(self, **kwargs): - Runner.update_config_file() - if 'noclean' in kwargs: self.clean_flag = not kwargs['noclean'] if 'report' in kwargs: -- cgit 1.2.3-korg