mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +00:00
Fix issue on nxos modules when transport is passed via provider (#22488)
The nxos modules read the task level transport variable, thus if the user pass it via provider the all fail with an UnboundLocalError. Fixes #22355
This commit is contained in:
committed by
Chris Alfonso
parent
0433be33bd
commit
9173a7727c
@@ -99,10 +99,7 @@ class ActionModule(_ActionModule):
|
||||
self._task.args['provider'] = provider_arg
|
||||
|
||||
# make sure a transport value is set in args
|
||||
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'] = transport
|
||||
|
||||
return super(ActionModule, self).run(tmp, task_vars)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user