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:
Nathaniel Case
2018-01-05 12:39:04 -05:00
committed by GitHub
parent a0ad7ffedf
commit c371ed8d30
199 changed files with 1589 additions and 684 deletions

View File

@@ -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.

View File

@@ -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)