1
0
Fork 0
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:
Peter Sprygada 2016-12-19 07:47:29 -05:00 committed by GitHub
parent c58461596a
commit 8f97ddd98a
2 changed files with 2 additions and 15 deletions

View file

@ -80,9 +80,3 @@ class TerminalModule(TerminalBase):
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'

View file

@ -30,7 +30,8 @@ class TerminalModule(TerminalBase):
terminal_prompts_re = [
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 = [
@ -51,11 +52,3 @@ class TerminalModule(TerminalBase):
self._connection.exec_command(cmd)
except AnsibleConnectionFailure:
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'