IOS XR cli tests move to network_cli (#34007)

* Update task definitions for network_cli

* Add connection to debug messages

* Specify connection for prepare task

* pc won't be around for connection=network_cli

* Assorted Python 3 fixes

* Give default port if ansible_ssh_port missing

* delegate -> connection

* Extend error regex
This commit is contained in:
Nathaniel Case 2017-12-20 11:26:09 -05:00 committed by GitHub
parent 5db9ac23ee
commit 2e76c89910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 154 additions and 107 deletions

View file

@ -61,9 +61,9 @@ class Cliconf(CliconfBase):
if source not in lookup:
return self.invalid_params("fetching configuration from %s is not supported" % source)
if filter:
cmd = to_bytes(b'show {0} {1}'.format(lookup[source], filter), errors='surrogate_or_strict')
cmd = to_bytes('show {0} {1}'.format(lookup[source], filter), errors='surrogate_or_strict')
else:
cmd = to_bytes(b'show {0}'.format(lookup[source]), errors='surrogate_or_strict')
cmd = to_bytes('show {0}'.format(lookup[source]), errors='surrogate_or_strict')
return self.send_command(cmd)
@ -76,10 +76,10 @@ class Cliconf(CliconfBase):
def commit(self, comment=None):
if comment:
command = b'commit comment {0}'.format(comment)
command = 'commit comment {0}'.format(comment)
else:
command = b'commit'
self.send_command(command)
command = 'commit'
self.send_command(to_bytes(command))
def discard_changes(self):
self.send_command(b'abort')