mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-03 07:41:30 -07:00
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:
parent
5db9ac23ee
commit
2e76c89910
48 changed files with 154 additions and 107 deletions
|
@ -40,7 +40,7 @@ class ActionModule(_ActionModule):
|
|||
try:
|
||||
self._handle_template()
|
||||
except ValueError as exc:
|
||||
return dict(failed=True, msg=exc.message)
|
||||
return dict(failed=True, msg=to_text(exc))
|
||||
|
||||
result = super(ActionModule, self).run(tmp, task_vars)
|
||||
|
||||
|
@ -54,7 +54,7 @@ class ActionModule(_ActionModule):
|
|||
|
||||
# strip out any keys that have two leading and two trailing
|
||||
# underscore characters
|
||||
for key in result.keys():
|
||||
for key in list(result.keys()):
|
||||
if PRIVATE_KEYS_RE.match(key):
|
||||
del result[key]
|
||||
|
||||
|
@ -74,7 +74,7 @@ class ActionModule(_ActionModule):
|
|||
os.remove(fn)
|
||||
tstamp = time.strftime("%Y-%m-%d@%H:%M:%S", time.localtime(time.time()))
|
||||
filename = '%s/%s_config.%s' % (backup_path, host, tstamp)
|
||||
open(filename, 'w').write(to_bytes(contents))
|
||||
open(filename, 'w').write(contents)
|
||||
return filename
|
||||
|
||||
def _handle_template(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue