From 49ca4c02797ac75a169ddc7cec3aa09cc4bfde4b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 9 Nov 2020 12:47:22 +0100 Subject: [PATCH] Update routeros.py (#138) (#9) * 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 3f3e0d0) Fore-ported from ansible-collections/community.network#138. --- .../fragments/community.network-138-routeros-allow-slash.yml | 2 ++ plugins/terminal/routeros.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/community.network-138-routeros-allow-slash.yml diff --git a/changelogs/fragments/community.network-138-routeros-allow-slash.yml b/changelogs/fragments/community.network-138-routeros-allow-slash.yml new file mode 100644 index 0000000..a28f7a4 --- /dev/null +++ b/changelogs/fragments/community.network-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 78996f2..0221b98 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\]: ?"), ]