增加auto retry指令清洗操作

Signed-off-by: deveco_xdevice <liguangjie1@huawei.com>
This commit is contained in:
deveco_xdevice 2023-09-11 11:47:26 +08:00
parent d328cb6c65
commit f93bbd08db

View File

@ -770,7 +770,8 @@ class Console(object):
@classmethod
def _wash_history_command(cls, history_command):
# clear redundant content in history command. e.g. repeat,sn
if "--repeat" in history_command or "-sn" in history_command:
if "--repeat" in history_command or "-sn" in history_command\
or "--auto_retry" in history_command:
split_list = list(history_command.split())
if "--repeat" in split_list:
pos = split_list.index("--repeat")
@ -778,6 +779,9 @@ class Console(object):
if "-sn" in split_list:
pos = split_list.index("-sn")
split_list = split_list[:pos] + split_list[pos + 2:]
if "--auto_retry" in split_list:
pos = split_list.index("--auto_retry")
split_list = split_list[:pos] + split_list[pos + 2:]
return " ".join(split_list)
else:
return history_command