From 6187703c7b3ace0d4adb790ad39fa38bf16bbaae Mon Sep 17 00:00:00 2001 From: svliron <73510650+svliron@users.noreply.github.com> Date: Sun, 8 Nov 2020 05:22:45 -0800 Subject: [PATCH] Update routeros.py (#138) * Update routeros.py Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise) * Add changelog fragment. Co-authored-by: Felix Fontein (cherry picked from commit 3f3e0d05a12124bed614a6790bcc23e610835a43) --- changelogs/fragments/138-routeros-allow-slash.yml | 2 ++ plugins/terminal/routeros.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/138-routeros-allow-slash.yml diff --git a/changelogs/fragments/138-routeros-allow-slash.yml b/changelogs/fragments/138-routeros-allow-slash.yml new file mode 100644 index 00000000..a28f7a46 --- /dev/null +++ b/changelogs/fragments/138-routeros-allow-slash.yml @@ -0,0 +1,2 @@ +bugfixes: +- "routeros terminal plugin - allow slashes in hostnames for terminal detection. Without this, slashes in hostnames will result in connection timeouts (https://github.com/ansible-collections/community.network/pull/138)." diff --git a/plugins/terminal/routeros.py b/plugins/terminal/routeros.py index 78996f28..0221b98d 100644 --- a/plugins/terminal/routeros.py +++ b/plugins/terminal/routeros.py @@ -47,7 +47,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\]: ?"), ]