diff options
Diffstat (limited to 'dovetail/utils/dovetail_config.py')
-rw-r--r-- | dovetail/utils/dovetail_config.py | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/dovetail/utils/dovetail_config.py b/dovetail/utils/dovetail_config.py index 5e100d69..98be8e62 100644 --- a/dovetail/utils/dovetail_config.py +++ b/dovetail/utils/dovetail_config.py @@ -1,5 +1,7 @@ #!/usr/bin/env python # +# Copyright (c) 2018 grakiss.wanglei@huawei.com and others. +# # grakiss.wanglei@huawei.com # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -16,21 +18,14 @@ class DovetailConfig(object): dovetail_config = {} @classmethod - def load_config_files(cls): - curr_path = os.path.dirname(os.path.abspath(__file__)) - config_path = os.path.join(os.path.dirname(curr_path), 'conf') - with open(os.path.join(config_path, 'dovetail_config.yml')) as f: + def load_config_files(cls, conf_path): + with open(os.path.join(conf_path, 'dovetail_config.yml')) as f: cls.dovetail_config = yaml.safe_load(f) - for extra_config_file in cls.dovetail_config['include_config']: - with open(os.path.join(config_path, extra_config_file)) as f: - extra_config = yaml.safe_load(f) - cls.dovetail_config.update(extra_config) - - path = os.path.join(config_path, cls.dovetail_config['cli_file_name']) + path = os.path.join(conf_path, cls.dovetail_config['cli_file_name']) with open(path) as f: cmd_yml = yaml.safe_load(f) - cls.dovetail_config['cli'] = cmd_yml[cmd_yml.keys()[0]] + cls.dovetail_config['cli'] = cmd_yml[list(cmd_yml.keys())[0]] # update dovetail_config dict with the giving path. # if path is in the dovetail_config dict, its value will be replaced. @@ -54,8 +49,3 @@ class DovetailConfig(object): def update_non_envs(cls, path, value): if value: cls.set_leaf_dict(cls.dovetail_config, path, value) - - @classmethod - def update_cmds(cls): - if cls.dovetail_config['report_dest'].startswith("http"): - cls.dovetail_config['bottlenecks']['cmds'][0] += ' --report' |