From 24d7ccd182004e73b655226fb34e2079e21bb68f Mon Sep 17 00:00:00 2001 From: Fran Fitzpatrick Date: Mon, 22 Oct 2018 10:38:12 -0500 Subject: [PATCH] Backport: junos terminal regex prompt fix to v2.7 (#47203) * Fix junos terminal regex (#47096) Fix junos stdout regex Change at hing (cherry picked from commit fc341e01face3544c649b54015605f94597e069c) * Changelog: adds fragment for junos fix terminal prompt regex * Proper yaml formatting --- changelogs/fragments/47096-junos-terminal-regex-fix.yml | 2 ++ lib/ansible/plugins/terminal/junos.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/47096-junos-terminal-regex-fix.yml diff --git a/changelogs/fragments/47096-junos-terminal-regex-fix.yml b/changelogs/fragments/47096-junos-terminal-regex-fix.yml new file mode 100644 index 0000000000..d4debca68c --- /dev/null +++ b/changelogs/fragments/47096-junos-terminal-regex-fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - junos - fix terminal prompt regex (https://github.com/ansible/ansible/pull/47096) diff --git a/lib/ansible/plugins/terminal/junos.py b/lib/ansible/plugins/terminal/junos.py index 63d1059025..2878e1ec60 100644 --- a/lib/ansible/plugins/terminal/junos.py +++ b/lib/ansible/plugins/terminal/junos.py @@ -36,7 +36,7 @@ except ImportError: class TerminalModule(TerminalBase): terminal_stdout_re = [ - re.compile(br"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$|%"), + re.compile(br"[\r\n]?[\w@+\-\.:\/\[\]]+[>#%] ?$"), ] terminal_stderr_re = [