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>
@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)