fixes bug with matching nxos prompts (#40655)

This change addresses an issue where the prompt matching regular
expressions would not match a prompt if the hostname starts with a
numeric value.  Before this change, the connection would fail with a
socket.timeout() error.  This change updates the termnal_stdout_re
values to now check for a number.

See Github issue #38639
pull/40665/head
Peter Sprygada 6 years ago committed by Trishna Guha
parent d7419b4dbc
commit d829ff6993

@ -30,8 +30,8 @@ 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_]{1}[a-zA-Z0-9-_.]*[>|#|%](?:\s*)*(\x1b\S+)*$'),
re.compile(br'[\r\n]?[a-zA-Z]{1}[a-zA-Z0-9-_.]*\(.+\)#(?:\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*)$')
]
terminal_stderr_re = [

Loading…
Cancel
Save