Adds a tmsh command fallback (#33592)

* Adds a tmsh command fallback

The bigip terminal plugin assumes that the remote shell is tmsh.
This is not always true. The remote shell may be bash sometimes.

This adds a different shell command in the case that bash is the
remote shell

* Fixing upstream errors
pull/33598/head
Tim Rupp 7 years ago committed by GitHub
parent 97fa41d338
commit 9e89d2be1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,5 +51,10 @@ class TerminalModule(TerminalBase):
def on_open_shell(self): def on_open_shell(self):
try: try:
self._exec_cli_command(b'modify cli preference display-threshold 0 pager disabled') self._exec_cli_command(b'modify cli preference display-threshold 0 pager disabled')
except AnsibleConnectionFailure: except AnsibleConnectionFailure as ex:
raise AnsibleConnectionFailure('unable to set terminal parameters') output = str(ex)
if 'modify: command not found' in output:
try:
self._exec_cli_command(b'tmsh modify cli preference display-threshold 0 pager disabled')
except AnsibleConnectionFailure as ex:
raise AnsibleConnectionFailure('unable to set terminal parameters')

Loading…
Cancel
Save