mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
nxos integration fix part 1 (#27069)
* Assorted Python 3 fixes * Fix `testcase` definition in integration tests * Fix nxos_acl_interface * clean up nxapi after nxos_nxapi
This commit is contained in:
@@ -41,7 +41,7 @@ class ActionModule(_ActionModule):
|
||||
try:
|
||||
self._handle_template()
|
||||
except ValueError as exc:
|
||||
return dict(failed=True, msg=exc.message)
|
||||
return dict(failed=True, msg=str(exc))
|
||||
|
||||
result = super(ActionModule, self).run(tmp, task_vars)
|
||||
|
||||
@@ -55,7 +55,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]
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ __metaclass__ = type
|
||||
import os
|
||||
import time
|
||||
import glob
|
||||
import urlparse
|
||||
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
||||
from ansible.plugins.action.nxos import ActionModule as _ActionModule
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class ActionModule(_ActionModule):
|
||||
try:
|
||||
self._handle_template()
|
||||
except (ValueError, AttributeError) as exc:
|
||||
return dict(failed=True, msg=exc.message)
|
||||
return dict(failed=True, msg=str(exc))
|
||||
|
||||
result = super(ActionModule, self).run(tmp, task_vars)
|
||||
|
||||
@@ -72,7 +72,7 @@ class ActionModule(_ActionModule):
|
||||
|
||||
working_path = self._get_working_path()
|
||||
|
||||
if os.path.isabs(src) or urlparse.urlsplit(src).scheme:
|
||||
if os.path.isabs(src) or urlsplit(src).scheme:
|
||||
source = src
|
||||
else:
|
||||
source = self._loader.path_dwim_relative(working_path, 'templates', src)
|
||||
|
||||
Reference in New Issue
Block a user