From 06fd9820a3d1138009e9a1156ec36d14737f133e Mon Sep 17 00:00:00 2001 From: abirami-n Date: Wed, 12 Sep 2018 19:28:32 +0530 Subject: [PATCH] Fixes handling of terminal_initial_prompt on dellos6 and dellos9 devices (#45273) * Fix terminal initial prompt on dellos6 and dellos9 * Fix_pylint --- lib/ansible/plugins/terminal/dellos6.py | 6 ++++++ lib/ansible/plugins/terminal/dellos9.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lib/ansible/plugins/terminal/dellos6.py b/lib/ansible/plugins/terminal/dellos6.py index 3d468b0e38..59f90bc56c 100644 --- a/lib/ansible/plugins/terminal/dellos6.py +++ b/lib/ansible/plugins/terminal/dellos6.py @@ -50,6 +50,12 @@ class TerminalModule(TerminalBase): ] + terminal_initial_prompt = br"\(y/n\)" + + terminal_initial_answer = b"y" + + terminal_inital_prompt_newline = False + def on_become(self, passwd=None): if self._get_prompt().endswith('#'): return diff --git a/lib/ansible/plugins/terminal/dellos9.py b/lib/ansible/plugins/terminal/dellos9.py index 8446f1aac8..ceb20f85b2 100644 --- a/lib/ansible/plugins/terminal/dellos9.py +++ b/lib/ansible/plugins/terminal/dellos9.py @@ -45,6 +45,10 @@ class TerminalModule(TerminalBase): re.compile(br"'[^']' +returned error code: ?\d+"), ] + terminal_initial_prompt = br"\[y/n\]:" + + terminal_initial_answer = b"y" + def on_open_shell(self): try: self._exec_cli_command(b'terminal length 0')