mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
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:
parent
c5452eef6f
commit
a6cecef6bc
11 changed files with 26 additions and 59 deletions
|
@ -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\-\.]+:\S+?[>#\$] ?$")
|
||||
]
|
||||
|
||||
terminal_errors_re = [
|
||||
terminal_stderr_re = [
|
||||
re.compile(r"\n\s*Invalid command:"),
|
||||
re.compile(r"\nCommit failed"),
|
||||
re.compile(r"\n\s+Set failed"),
|
||||
|
@ -48,9 +48,3 @@ class TerminalModule(TerminalBase):
|
|||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
||||
@staticmethod
|
||||
def guess_network_os(conn):
|
||||
stdin, stdout, stderr = conn.exec_command('cat /etc/issue')
|
||||
if 'VyOS' in stdout.read():
|
||||
return 'vyos'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue