diff options
author | wu.zhihui <wu.zhihui1@zte.com.cn> | 2016-11-29 18:02:15 +0800 |
---|---|---|
committer | zhihui wu <wu.zhihui1@zte.com.cn> | 2016-11-30 02:16:42 +0000 |
commit | 16b897a7a9473511a201ec43ab253e21a869fed2 (patch) | |
tree | 04793bd37f330bfce96b5790f03257f4f6b7260d | |
parent | 2803c022fc5ad60f9240bcbba46ffa1297de06c4 (diff) |
dovetail: modify process flow in function update_envs()
bugfix task DOVETAIL-144
1. If run command "python run.py" without options, e.g. --SUT_TYPE, --SUT_IP,
env values will be updated by os enviromental parameter.
2. If run command "python run.py" with options, no update from os enviromental
parameter.
JIRA: DOVETAIL-144
Change-Id: Id3bde7546722a5f4defe52d4f00609d7049a288b
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
-rw-r--r-- | dovetail/conf/dovetail_config.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dovetail/conf/dovetail_config.py b/dovetail/conf/dovetail_config.py index 8fa1a6d2..9dcf5ffa 100644 --- a/dovetail/conf/dovetail_config.py +++ b/dovetail/conf/dovetail_config.py @@ -47,9 +47,10 @@ class DovetailConfig: @classmethod def update_envs(cls, options): for item in options: - if options[item] is not None: - key = cls.cmd_name_trans(item) - os.environ[key] = options[item] + key = cls.cmd_name_trans(item) + if not options[item] and key in os.environ: + options[item] = os.environ[key] + if options[item]: cls.update_config_envs('functest', key) cls.update_config_envs('yardstick', key) |