clean up of terminal plugins (#21549)

* removes unneeded supports_multiplexing var
* refactors terminal_prompts_re to terminal_stdout_re
* refactors terminal_errors_re to terminal_stderr_re
* updates network_cli unit test cases
This commit is contained in:
Peter Sprygada 2017-02-17 10:00:23 -05:00 committed by GitHub
parent c5452eef6f
commit a6cecef6bc
11 changed files with 26 additions and 59 deletions

View file

@ -28,12 +28,12 @@ from ansible.errors import AnsibleConnectionFailure
class TerminalModule(TerminalBase):
terminal_prompts_re = [
terminal_stdout_re = [
re.compile(r"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
re.compile(r"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$")
]
terminal_errors_re = [
terminal_stderr_re = [
re.compile(r"% ?Error"),
re.compile(r"^% \w+", re.M),
re.compile(r"% ?Bad secret"),
@ -44,8 +44,6 @@ class TerminalModule(TerminalBase):
re.compile(r"'[^']' +returned error code: ?\d+"),
]
supports_multiplexing = False
def on_open_shell(self):
try:
self._exec_cli_command('terminal length 0')