mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07: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:
parent
118d2cda24
commit
d72eb08902
13 changed files with 33 additions and 29 deletions
|
@ -131,10 +131,9 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
from ansible.module_utils.six import iteritems
|
||||
|
||||
def check_args(module, warnings):
|
||||
transport = module.params['transport']
|
||||
provider_transport = (module.params['provider'] or {}).get('transport')
|
||||
if 'nxapi' in (transport, provider_transport):
|
||||
module.fail_json(msg='transport=nxapi is not supporting when configuring nxapi')
|
||||
provider = module.params['provider']
|
||||
if provider['transport'] == 'nxapi':
|
||||
module.fail_json(msg='module not supported over nxapi transport')
|
||||
|
||||
nxos_check_args(module, warnings)
|
||||
|
||||
|
@ -149,9 +148,6 @@ def check_args(module, warnings):
|
|||
warnings.append('state=stopped is deprecated and will be removed in a '
|
||||
'a future release. Please use state=absent instead')
|
||||
|
||||
if module.params['transport'] == 'nxapi':
|
||||
module.fail_json(msg='module not supported over nxapi transport')
|
||||
|
||||
for key in ['config']:
|
||||
if module.params[key]:
|
||||
warnings.append('argument %s is deprecated and will be ignored' % key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue