mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Fix nxos provider transport warning issue (#30610)
* Fix nxos provider transport warning issue * Add default value of transport arg in provider spec * Remove default value if transport arg in top level spec This ensure deprecation warning is seen only in case transport is given as a top level arg in task * Refactor nxos modules to reference transport value from provider spec * Fix unit test * Remove transport arg assignment in nxos action plugin * As assigning transport value is handled in provider spec top level task arg assignment is no longer required
This commit is contained in:
@@ -29,6 +29,9 @@ from ansible.module_utils._text import to_bytes
|
||||
|
||||
|
||||
def set_module_args(args):
|
||||
if 'provider' not in args:
|
||||
args['provider'] = {'transport': args.get('transport') or 'cli'}
|
||||
|
||||
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
|
||||
basic._ANSIBLE_ARGS = to_bytes(args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user