Repository: ansible/ansible

Issue:
eos_banner 
##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
eos_banner

##### ANSIBLE VERSION
```
ansible 2.3.0 (test_eos_banner 89bf14e467) last updated 2017/02/27 18:21:15 (GMT +100)

```

##### SUMMARY
Appears we are trying to read `transport` even on new 2.3 modules.

```yaml
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_rdVUTA/ansible_module_eos_banner.py", line 161, in <module>
    main()
  File "/tmp/ansible_rdVUTA/ansible_module_eos_banner.py", line 145, in main
    have = map_config_to_obj(module)
  File "/tmp/ansible_rdVUTA/ansible_module_eos_banner.py", line 109, in map_config_to_obj
    output = run_commands(module, ['show banner %s' % module.params['banner']])
  File "/tmp/ansible_rdVUTA/ansible_modlib.zip/ansible/module_utils/eos.py", line 442, in run_commands
  File "/tmp/ansible_rdVUTA/ansible_modlib.zip/ansible/module_utils/eos.py", line 79, in get_connection
KeyError: 'transport'
```


##### STEPS TO REPRODUCE
```yaml
- name: setup - remove login
  eos_banner:
    banner: login
    state: absent


```


##### EXPECTED RESULTS
##### ACTUAL RESULTS
```
 16316 1488225144.93538: in local.exec_command()
<veos01> EXEC /bin/sh -c 'python /home/johnb/.ansible/tmp/ansible-tmp-1488225144.91-133299287621947/eos_banner.py; rm -rf "/home/johnb/.ansible/tmp/ansible-tmp-1488225144.91-133299287621947/" > /dev/null 2>&1 && sleep 0'
 16316 1488225144.93550: opening command with Popen()
 16316 1488225144.93824: done running command with Popen()
 16316 1488225144.93869: getting output with communicate()
 16316 1488225145.11188: done communicating
 16316 1488225145.11215: done with local.exec_command()
 16316 1488225145.11232: _low_level_execute_command() done: rc=0, stdout=, stderr=Traceback (most recent call last):
  File "/tmp/ansible_rdVUTA/ansible_module_eos_banner.py", line 161, in <module>
    main()
  File "/tmp/ansible_rdVUTA/ansible_module_eos_banner.py", line 145, in main
    have = map_config_to_obj(module)
  File "/tmp/ansible_rdVUTA/ansible_module_eos_banner.py", line 109, in map_config_to_obj
    output = run_commands(module, ['show banner %s' % module.params['banner']])
  File "/tmp/ansible_rdVUTA/ansible_modlib.zip/ansible/module_utils/eos.py", line 442, in run_commands
  File "/tmp/ansible_rdVUTA/ansible_modlib.zip/ansible/module_utils/eos.py", line 79, in get_connection
KeyError: 'transport'

 [WARNING]: Removed unexpected internal key in module return: _ansible_parsed = False

```



Discussion:
cc @privateip @Qalthos
[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/eos/eos_banner.py b/lib/ansible/modules/network/eos/eos_banner.py
--- a/lib/ansible/modules/network/eos/eos_banner.py
+++ b/lib/ansible/modules/network/eos/eos_banner.py
@@ -94,6 +94,7 @@
 """
 from ansible.module_utils.basic import AnsibleModule
 from ansible.module_utils.eos import load_config, run_commands
+from ansible.module_utils.eos import eos_argument_spec, check_args
 
 def map_obj_to_commands(updates, module):
     commands = list()
@@ -139,13 +140,20 @@ def main():
         state=dict(default='present', choices=['present', 'absent'])
     )
 
+    argument_spec.update(eos_argument_spec)
+
     required_if = [('state', 'present', ('text',))]
 
     module = AnsibleModule(argument_spec=argument_spec,
                            required_if=required_if,
                            supports_check_mode=True)
 
+    warnings = list()
+    check_args(module, warnings)
+
     result = {'changed': False}
+    if warnings:
+        result['warnings'] = warnings
 
     want = map_params_to_obj(module)
     have = map_config_to_obj(module)


Test patch: