1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Adds regex for stdout needed for changing root password and regex for stderr catching problems with the password. (#31955)

This commit is contained in:
James Mighion 2017-10-19 16:52:14 -07:00 committed by Tim Rupp
parent 3c271e6bf6
commit bb4b98a82e

View file

@ -30,7 +30,8 @@ class TerminalModule(TerminalBase):
terminal_stdout_re = [ terminal_stdout_re = [
re.compile(br"[\r\n]?(?:\([^\)]+\)){,5}(?:>|#) ?$"), re.compile(br"[\r\n]?(?:\([^\)]+\)){,5}(?:>|#) ?$"),
re.compile(br"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"), re.compile(br"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
re.compile(br"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$") re.compile(br"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$"),
re.compile(br"(?:new|confirm) password:")
] ]
terminal_stderr_re = [ terminal_stderr_re = [
@ -40,6 +41,7 @@ class TerminalModule(TerminalBase):
re.compile(br"invalid input", re.I), re.compile(br"invalid input", re.I),
re.compile(br"(?:incomplete|ambiguous) command", re.I), re.compile(br"(?:incomplete|ambiguous) command", re.I),
re.compile(br"connection timed out", re.I), re.compile(br"connection timed out", re.I),
re.compile(br"the new password was not confirmed", re.I),
re.compile(br"[^\r\n]+ not found", re.I), re.compile(br"[^\r\n]+ not found", re.I),
re.compile(br"'[^']' +returned error code: ?\d+"), re.compile(br"'[^']' +returned error code: ?\d+"),
re.compile(br"[^\r\n]\/bin\/(?:ba)?sh") re.compile(br"[^\r\n]\/bin\/(?:ba)?sh")