mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
fixes import statement in nxos_facts module (#21834)
trying to import from the wrong shared lib, this patch changes network_common to connection. Also fixes a bug found in the nxos action plugin to detect transport fixes #21829
This commit is contained in:
committed by
John R Barker
parent
551a765ea5
commit
ab0f992b3a
@@ -181,7 +181,7 @@ import re
|
|||||||
from ansible.module_utils.nxos import run_commands
|
from ansible.module_utils.nxos import run_commands
|
||||||
from ansible.module_utils.nxos import nxos_argument_spec, check_args
|
from ansible.module_utils.nxos import nxos_argument_spec, check_args
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.network_common import exec_command
|
from ansible.module_utils.connection import exec_command
|
||||||
from ansible.module_utils.six import iteritems
|
from ansible.module_utils.six import iteritems
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,9 @@ class ActionModule(_ActionModule):
|
|||||||
self._task.args['provider'] = provider_arg
|
self._task.args['provider'] = provider_arg
|
||||||
|
|
||||||
# make sure a transport value is set in args
|
# make sure a transport value is set in args
|
||||||
if self._task.args.get('transport') is None and self._task.args.get('provider').get('transport') is None:
|
transport = self._task.args.get('transport')
|
||||||
|
provider_transport = (self._task.args.get('provider') or {}).get('transport')
|
||||||
|
if all((transport is None, provider_transport is None)):
|
||||||
self._task.args['transport'] = 'cli'
|
self._task.args['transport'] = 'cli'
|
||||||
|
|
||||||
return super(ActionModule, self).run(tmp, task_vars)
|
return super(ActionModule, self).run(tmp, task_vars)
|
||||||
|
|||||||
Reference in New Issue
Block a user