Привет, я пытаюсь написать диалоговое действие в моем скрипте.
Ниже я прилагаю свой код и мою ошибку
Может кто-нибудь помочь мне в этом, пожалуйста.
Мой фактический запрос: Предупреждение: файл с таким именем уже существует. Хотите перезаписать (да / нет)? [N]
код:
dialog = Dialog([
Statement(pattern=r'.*Warning: There is already a file existing with this name.\s* Do you want to overwrite \(y/n\)\?\s* \[no\]',
action='sendline(y)',
loop_continue=True,
continue_timer=False)
])
ОШИБКА:
Bi2_MPLS# 57: sarmanoh-lnx-v1: 2019-01-24T02:55:29: %CSCCON-4-WARNING: %[pid=1946][pname=__task1]: Value passed to -reply in not a OrderedDict, which might effect the expect pattern evaluation
58: 'Dialog' object has no attribute 'keys'
59: Caught exception during execution:
60: Traceback (most recent call last):
61: File "/ws/sarasha2-sjc/pyats/bifrost_mpls/sysb.py", line 4158, in test
62: testbed.devices[ele].execute('copy running-config bootflash:bi1_mpls_config_jan_24', reply=dialog)
63: File "/ws/sarasha2-sjc/pyats/lib/python3.4/site-packages/csccon/services/bases.py", line 152, in __call__
64: return super().__call__(*args, **kwargs)
65: File "/ws/sarasha2-sjc/pyats/lib/python3.4/site-packages/csccon/services/abstractService.py", line 59, in __call__
66: self.call_service(*args, **kwargs)
67: File "/ws/sarasha2-sjc/pyats/lib/python3.4/site-packages/csccon/services/router_services.py", line 57, in call_service
68: for dictkey in val.keys():
69: AttributeError: 'Dialog' object has no attribute 'keys'
70: The result of section test is => ERRORED
Спасибо
Сараванан S