Adding new stdout regex to allow local password changes. Adding stderr regex to catch more errors. (#30994)

This commit is contained in:
James Mighion 2017-09-27 21:35:14 -07:00 committed by Ganesh Nalawade
parent 9f5cba84b8
commit 2837200aea

View file

@ -30,11 +30,14 @@ from ansible.plugins.terminal import TerminalBase
class TerminalModule(TerminalBase): class TerminalModule(TerminalBase):
terminal_stdout_re = [ terminal_stdout_re = [
re.compile(br"[\r\n]?[\w]*\(.+\) ?#(?:\s*)$") re.compile(br"[\r\n]?[\w]*\(.+\) ?#(?:\s*)$"),
re.compile(br"[pP]assword:$")
] ]
terminal_stderr_re = [ terminal_stderr_re = [
re.compile(br"% ?Error"), re.compile(br"% ?Error"),
re.compile(br"Error:", re.M),
re.compile(br"^% \w+", re.M),
re.compile(br"% ?Bad secret"), re.compile(br"% ?Bad secret"),
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),