Repository: ansible/ansible

Issue:
nxos_vlan issues warning about arguments even though arguments are not used


##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report


##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->
nxos_vlan

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.4.0.0
  config file = /home/kbyers/.ansible.cfg
  configured module search path = [u'/home/kbyers/napalm-ansible/library', u'/home/kbyers/ansible-extras/ntc-ansible/library']
  ansible python module location = /home/kbyers/VENV/ans_2_4/local/lib/python2.7/site-packages/ansible
  executable location = /home/kbyers/VENV/ans_2_4/bin/ansible
  python version = 2.7.12 (default, Sep  1 2016, 22:14:00) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]

```


##### OS / ENVIRONMENT
<!---
N/A
-->

##### SUMMARY
<!--- Explain the problem briefly -->
nxos_vlan module gives warning about arguments even though arguments not in use:

```
 [WARNING]: argument include_defaults is no longer supported, ignoring value

 [WARNING]: argument save is no longer supported, ignoring value
```



##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
---
- name: Test NXOS VLAN
  hosts: nxos
  tasks:
    - name: Configure NEXUS VLANs
      nxos_vlan:
        provider: "{{ provider_nxapi }}"
        vlan_id: "{{ item.vlan_id }}"
        name: "{{ item.name }}"
      with_items: "{{ vlans }}"

```

The arguments are probably embedded as defaults in the module. My playbook is not referring to them at all.

Module should be fixed so that warnings no longer appear.


Discussion:
cc @GGabriele @jedelman8 @mikewiebe @privateip @rahushen @rcarrillocruz @trishnaguha
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/network/nxos/nxos_vlan.py b/lib/ansible/modules/network/nxos/nxos_vlan.py
--- a/lib/ansible/modules/network/nxos/nxos_vlan.py
+++ b/lib/ansible/modules/network/nxos/nxos_vlan.py
@@ -113,8 +113,7 @@
 import re
 
 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 check_args as nxos_check_args
+from ansible.module_utils.nxos import nxos_argument_spec, check_args
 from ansible.module_utils.basic import AnsibleModule
 
 
@@ -280,14 +279,6 @@ def apply_value_map(value_map, 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():
     argument_spec = dict(
         vlan_id=dict(required=False, type='str'),
@@ -298,11 +289,6 @@ def main():
         state=dict(choices=['present', 'absent'], default='present', required=False),
         admin_state=dict(choices=['up', 'down'], 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)
@@ -314,7 +300,7 @@ def main():
 
     warnings = list()
     check_args(module, warnings)
-    results = dict(changed=False, warnings=warnings)
+    results = dict(changed=False)
 
     vlan_range = module.params['vlan_range']
     vlan_id = module.params['vlan_id']


Test patch: