mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
removes network os guess static method (#19467)
For devices that do not support mutliplexing, we cannot automatically determine the network os. This removes the os guess static method from the terminal plugin. For this devices, the network_os value must be configured
This commit is contained in:
parent
c58461596a
commit
8f97ddd98a
2 changed files with 2 additions and 15 deletions
|
@ -80,9 +80,3 @@ class TerminalModule(TerminalBase):
|
||||||
self._exec_cli_command('disable')
|
self._exec_cli_command('disable')
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def guess_network_os(conn):
|
|
||||||
stdin, stdout, stderr = conn.exec_command('show version')
|
|
||||||
if 'Cisco IOS Software' in stdout.read():
|
|
||||||
return 'ios'
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ class TerminalModule(TerminalBase):
|
||||||
|
|
||||||
terminal_prompts_re = [
|
terminal_prompts_re = [
|
||||||
re.compile(r"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
|
re.compile(r"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
|
||||||
re.compile(r"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$")
|
re.compile(r"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$"),
|
||||||
|
re.compile(r']]>]]>[\r\n]?')
|
||||||
]
|
]
|
||||||
|
|
||||||
terminal_errors_re = [
|
terminal_errors_re = [
|
||||||
|
@ -51,11 +52,3 @@ class TerminalModule(TerminalBase):
|
||||||
self._connection.exec_command(cmd)
|
self._connection.exec_command(cmd)
|
||||||
except AnsibleConnectionFailure:
|
except AnsibleConnectionFailure:
|
||||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def guess_network_os(conn):
|
|
||||||
stdin, stdout, stderr = conn.exec_command('show version')
|
|
||||||
if 'Cisco IOS XR' in stdout.read():
|
|
||||||
return 'iosxr'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue