From 309e2b1910002ae7d7bbeab1c7a96f65181cc84a Mon Sep 17 00:00:00 2001 From: Tomas Herfert <68421396+therfert@users.noreply.github.com> Date: Thu, 17 Nov 2022 21:03:42 +0100 Subject: [PATCH] terminal regex udpate to match the terminal prompt in safe mode (#134) * terminal regex udpate to match the terminal prompt in safe mode Signed-off-by: Tomas Herfert * changelog Signed-off-by: Tomas Herfert * yamllint fix Signed-off-by: Tomas Herfert * Update changelogs/fragments/134-command-safemode.yml Co-authored-by: Felix Fontein Signed-off-by: Tomas Herfert Co-authored-by: Tomas Herfert Co-authored-by: Felix Fontein --- changelogs/fragments/134-command-safemode.yml | 3 +++ plugins/terminal/routeros.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/134-command-safemode.yml diff --git a/changelogs/fragments/134-command-safemode.yml b/changelogs/fragments/134-command-safemode.yml new file mode 100644 index 0000000..4482d92 --- /dev/null +++ b/changelogs/fragments/134-command-safemode.yml @@ -0,0 +1,3 @@ +bugfixes: + - "command, facts - commands do not timeout in safe mode anymore + (https://github.com/ansible-collections/community.routeros/pull/134)." diff --git a/plugins/terminal/routeros.py b/plugins/terminal/routeros.py index a2646e3..1d3fa6c 100644 --- a/plugins/terminal/routeros.py +++ b/plugins/terminal/routeros.py @@ -33,7 +33,7 @@ class TerminalModule(TerminalBase): terminal_stdout_re = [ re.compile(br"\x1b<"), - re.compile(br"\[[\w\-\.]+\@[\w\s\-\.\/]+\] ?> ?$"), + re.compile(br"\[[\w\-\.]+\@[\w\s\-\.\/]+\] ?( ?$"), re.compile(br"Please press \"Enter\" to continue!"), re.compile(br"Do you want to see the software license\? \[Y\/n\]: ?"), ]