mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
nxos tests to use network_cli (#34474)
* Fix over-byte * Fix nxos_l2_interface docs * Update connections for tasks * Add default ssh port * Only report provider when using connection=local * Send empty provider when connection=network_cli * Fix find tasks
This commit is contained in:
@@ -31,7 +31,7 @@ options:
|
||||
- Full name of the interface excluding any logical
|
||||
unit number, i.e. Ethernet1/1.
|
||||
required: true
|
||||
aliases: interface
|
||||
aliases: ['interface']
|
||||
mode:
|
||||
description:
|
||||
- Mode in which interface needs to be configured.
|
||||
@@ -49,7 +49,7 @@ options:
|
||||
- List of VLANs to be configured in trunk port.
|
||||
If C(mode=trunk), used as the VLAN range to ADD or REMOVE
|
||||
from the trunk.
|
||||
aliases: trunk_add_vlans
|
||||
aliases: ['trunk_add_vlans']
|
||||
trunk_allowed_vlans:
|
||||
description:
|
||||
- List of allowed VLANs in a given trunk port.
|
||||
|
||||
@@ -33,9 +33,9 @@ class Cliconf(CliconfBase):
|
||||
device_info = {}
|
||||
|
||||
device_info['network_os'] = 'nxos'
|
||||
reply = self.get(b'show version | json')
|
||||
reply = self.get('show version | json')
|
||||
data = json.loads(reply)
|
||||
platform_reply = self.get(b'show inventory | json')
|
||||
platform_reply = self.get('show inventory | json')
|
||||
platform_info = json.loads(platform_reply)
|
||||
|
||||
device_info['network_os_version'] = data.get('sys_ver_str') or data.get('kickstart_ver_str')
|
||||
@@ -53,7 +53,7 @@ class Cliconf(CliconfBase):
|
||||
def get_config(self, source='running', flags=None):
|
||||
lookup = {'running': 'running-config', 'startup': 'startup-config'}
|
||||
|
||||
cmd = b'show {} '.format(lookup[source])
|
||||
cmd = 'show {} '.format(lookup[source])
|
||||
cmd += ' '.join(flags)
|
||||
cmd = cmd.strip()
|
||||
|
||||
@@ -61,7 +61,7 @@ class Cliconf(CliconfBase):
|
||||
|
||||
def edit_config(self, command):
|
||||
responses = []
|
||||
for cmd in chain([b'configure'], to_list(command), [b'end']):
|
||||
for cmd in chain(['configure'], to_list(command), ['end']):
|
||||
responses.append(self.send_command(cmd))
|
||||
|
||||
return json.dumps(responses)
|
||||
|
||||
Reference in New Issue
Block a user