1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix nxos_vlan unexpected deprecation warning (#31624)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2017-10-12 12:00:35 +05:30 committed by GitHub
parent 9d811a34c4
commit c002b47a79

View file

@ -113,8 +113,7 @@ commands:
import re import re
from ansible.module_utils.nxos import get_config, load_config, run_commands from ansible.module_utils.nxos import get_config, load_config, run_commands
from ansible.module_utils.nxos import nxos_argument_spec from ansible.module_utils.nxos import nxos_argument_spec, check_args
from ansible.module_utils.nxos import check_args as nxos_check_args
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
@ -280,14 +279,6 @@ def apply_value_map(value_map, resource):
return resource return resource
def check_args(module, warnings):
nxos_check_args(module, warnings)
for key in ('include_defaults', 'config', 'save'):
if module.params[key] is not None:
warnings.append('argument %s is no longer supported, ignoring value' % key)
def main(): def main():
argument_spec = dict( argument_spec = dict(
vlan_id=dict(required=False, type='str'), vlan_id=dict(required=False, type='str'),
@ -298,11 +289,6 @@ def main():
state=dict(choices=['present', 'absent'], default='present', required=False), state=dict(choices=['present', 'absent'], default='present', required=False),
admin_state=dict(choices=['up', 'down'], required=False), admin_state=dict(choices=['up', 'down'], required=False),
mode=dict(choices=['ce', 'fabricpath'], required=False), mode=dict(choices=['ce', 'fabricpath'], required=False),
# Deprecated in Ansible 2.4
include_defaults=dict(default=False),
config=dict(),
save=dict(type='bool', default=False)
) )
argument_spec.update(nxos_argument_spec) argument_spec.update(nxos_argument_spec)
@ -314,7 +300,7 @@ def main():
warnings = list() warnings = list()
check_args(module, warnings) check_args(module, warnings)
results = dict(changed=False, warnings=warnings) results = dict(changed=False)
vlan_range = module.params['vlan_range'] vlan_range = module.params['vlan_range']
vlan_id = module.params['vlan_id'] vlan_id = module.params['vlan_id']