From 11cfa96797808faf2feb9a4fbfb29f64c810507d Mon Sep 17 00:00:00 2001 From: thetuxkeeper Date: Wed, 12 Sep 2018 15:59:42 +0200 Subject: [PATCH] fixing bytes <-> str regexp issue in cloudengine (#45285) --- lib/ansible/plugins/terminal/ce.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/ansible/plugins/terminal/ce.py b/lib/ansible/plugins/terminal/ce.py index e55952bbbc..557fcf3ac5 100644 --- a/lib/ansible/plugins/terminal/ce.py +++ b/lib/ansible/plugins/terminal/ce.py @@ -28,23 +28,23 @@ from ansible.errors import AnsibleConnectionFailure class TerminalModule(TerminalBase): terminal_stdout_re = [ - re.compile(r'[\r\n]?<.+>(?:\s*)$'), - re.compile(r'[\r\n]?\[.+\](?:\s*)$'), + re.compile(br'[\r\n]?<.+>(?:\s*)$'), + re.compile(br'[\r\n]?\[.+\](?:\s*)$'), ] terminal_stderr_re = [ - re.compile(r"% ?Error: "), - re.compile(r"^% \w+", re.M), - re.compile(r"% ?Bad secret"), - re.compile(r"invalid input", re.I), - re.compile(r"(?:incomplete|ambiguous) command", re.I), - re.compile(r"connection timed out", re.I), - re.compile(r"[^\r\n]+ not found", re.I), - re.compile(r"'[^']' +returned error code: ?\d+"), - re.compile(r"syntax error"), - re.compile(r"unknown command"), - re.compile(r"Error\[\d+\]: ", re.I), - re.compile(r"Error:", re.I) + re.compile(br"% ?Error: "), + re.compile(br"^% \w+", re.M), + re.compile(br"% ?Bad secret"), + re.compile(br"invalid input", re.I), + re.compile(br"(?:incomplete|ambiguous) command", re.I), + re.compile(br"connection timed out", re.I), + re.compile(br"[^\r\n]+ not found", re.I), + re.compile(br"'[^']' +returned error code: ?\d+"), + re.compile(br"syntax error"), + re.compile(br"unknown command"), + re.compile(br"Error\[\d+\]: ", re.I), + re.compile(br"Error:", re.I) ] def on_open_shell(self):