Fix ios and iosxr terminal prompt regex (#39063) (#39089)

Fixes #38732

Make matching leading newline for cli prompt
optional as there are cases when returned repsonse
for ios/iosx remote host doesn't have newline before
cli prompt.
(cherry picked from commit eebfa66c2b)
pull/39153/head
Ganesh Nalawade 7 years ago committed by GitHub
parent d6872a7b07
commit 94d40c8515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- Fix ios and iosxr terminal prompt regex (https://github.com/ansible/ansible/pull/39063)

@ -30,7 +30,7 @@ from ansible.plugins.terminal import TerminalBase
class TerminalModule(TerminalBase): class TerminalModule(TerminalBase):
terminal_stdout_re = [ terminal_stdout_re = [
re.compile(br"[\r\n][\w\+\-\.:\/\[\]]+(?:\([^\)]+\)){0,3}(?:[>#]) ?$") re.compile(br"[\r\n]?[\w\+\-\.:\/\[\]]+(?:\([^\)]+\)){0,3}(?:[>#]) ?$")
] ]
terminal_stderr_re = [ terminal_stderr_re = [

@ -29,7 +29,7 @@ from ansible.errors import AnsibleConnectionFailure
class TerminalModule(TerminalBase): class TerminalModule(TerminalBase):
terminal_stdout_re = [ terminal_stdout_re = [
re.compile(br"[\r\n][\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"), re.compile(br"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
re.compile(br']]>]]>[\r\n]?') re.compile(br']]>]]>[\r\n]?')
] ]

Loading…
Cancel
Save