From 52e4d2b36c8bda739086676d1ea97762d62ebc4a Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Tue, 25 Sep 2018 21:29:20 +0530 Subject: [PATCH] [2.5] Fix python2.6 `nothing to repeat` nxos terminal plugin bug (#45283) * fix python26 nxos terminal plugin bug (#45271) Signed-off-by: Trishna Guha (cherry picked from commit c98494d5bf94df78cc8ec41c679b3229688809fc) * nxos terminal plugin changelog Signed-off-by: Trishna Guha * Update nxos_terminal_plugin_2.5.yaml --- changelogs/fragments/nxos_terminal_plugin_2.5.yaml | 2 ++ lib/ansible/plugins/terminal/nxos.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/nxos_terminal_plugin_2.5.yaml diff --git a/changelogs/fragments/nxos_terminal_plugin_2.5.yaml b/changelogs/fragments/nxos_terminal_plugin_2.5.yaml new file mode 100644 index 00000000000..ca1066e0af9 --- /dev/null +++ b/changelogs/fragments/nxos_terminal_plugin_2.5.yaml @@ -0,0 +1,2 @@ +bugfixes: +- nxos terminal plugin - fix python2.6 `nothing to repeat` bug (https://github.com/ansible/ansible/pull/45271). diff --git a/lib/ansible/plugins/terminal/nxos.py b/lib/ansible/plugins/terminal/nxos.py index ac9218118f6..812fda945f7 100644 --- a/lib/ansible/plugins/terminal/nxos.py +++ b/lib/ansible/plugins/terminal/nxos.py @@ -30,7 +30,7 @@ from ansible.module_utils._text import to_bytes, to_text class TerminalModule(TerminalBase): terminal_stdout_re = [ - re.compile(br'[\r\n](?!\s*<)?(\x1b\S+)*[a-zA-Z_0-9]{1}[a-zA-Z0-9-_.]*[>|#](?:\s*)*(\x1b\S+)*$'), + re.compile(br'[\r\n](?!\s*<)?(\x1b\S+)*[a-zA-Z_0-9]{1}[a-zA-Z0-9-_.]*[>|#](?:\s*)(\x1b\S+)*$'), re.compile(br'[\r\n]?[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*\(.+\)#(?:\s*)$') ]