Repository: ansible/ansible

Issue:
aruba_command: 'no page'/'no paging' command
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report

##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->
aruba_command

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.4.0.0
  config file = <home>/.ansible.cfg
  configured module search path = [u'<home>/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
```

##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"

Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).

-->
```
DEFAULT_HOST_LIST(<home>/.ansible.cfg) = [u'<home>/ansible/inventory']
DEFAULT_VAULT_PASSWORD_FILE<home>/.ansible.cfg) = <home>/ansible/.vault_password.txt
HOST_KEY_CHECKING(<home>/.ansible.cfg) = False
RETRY_FILES_ENABLED(<home>/.ansible.cfg) = False
```

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.


-->
This from the network device:
```
Image stamp:    :/ws/swbuildm/rel_tacoma_qaoff/code/build/bom(swbuildm_rel_tacoma_qaoff_rel_tacoma)
                Dec 15 2016 10:06:38
                KB.16.03.0003
                383
Boot Image:     Primary

Boot ROM Version:    KB.16.01.0008
Active Boot ROM:     Primary
```

##### SUMMARY
<!--- Explain the problem briefly -->
The plugins/terminal/aruba.py file sends a 'no paging' command at the beginning of the SSH session. On my OS version, however, the command should be 'no page'.

The 'no paging' command, when run directly on the switch returns "Invalid input: paging"
When run in ansible, it simply says 'unable to open shell', with some other related information.

##### 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.
-->
Simply try to log into a switch with the right OS using the aruba_command or aruba_config module.

<!--- Paste example playbooks or commands between quotes below -->
```yaml
---
- name: Pull LLDP Information from Aruba devices
  hosts: aruba
  gather_facts: no
  vars:
    login:
        host: "{{ inventory_hostname }}"
  tasks:
  - aruba_command:
      provider: "{{ login }}"

```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
I expected it to successfully establish an SSH connection to the switch

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
It said it failed to open the shell

<!--- Paste verbatim command output between quotes below -->
```
ansible-playbook 2.4.0.0
  config file = <path>/.ansible.cfg
  configured module search path = [u'<path>/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
Using <path>/.ansible.cfg as config file
Parsed <path>/ansible/inventory/hosts inventory source with ini plugin

PLAYBOOK: aruba.yml *********************************************************************************
1 plays in aruba.yml

PLAY [Log into Aruba Devices] ************************************************************************
META: ran handlers

TASK [aruba_command] ********************************************************************************
task path: <path>/ansible/playbooks/aruba.yml:9
<host1> using connection plugin network_cli
<host2> using connection plugin network_cli
fatal: [host1]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell"
}
fatal: [host2]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell"
}

PLAY RECAP ******************************************************************************************
host1    : ok=0    changed=0    unreachable=0    failed=1   
host2    : ok=0    changed=0    unreachable=0    failed=1
```



Discussion:
cc @jmighion
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
I'll look into this today. Should have something by EOW.

Resolving patch:
diff --git a/lib/ansible/plugins/terminal/aruba.py b/lib/ansible/plugins/terminal/aruba.py
--- a/lib/ansible/plugins/terminal/aruba.py
+++ b/lib/ansible/plugins/terminal/aruba.py
@@ -48,6 +48,6 @@ class TerminalModule(TerminalBase):
 
     def on_open_shell(self):
         try:
-            self._exec_cli_command(b'no paging')
+            self._exec_cli_command(b'no pag')
         except AnsibleConnectionFailure:
             raise AnsibleConnectionFailure('unable to set terminal parameters')


Test patch: