Adds various fixes for f5 modules (#40208)

* Adds stty expansion for cli commands
* minor fixes
* Make bigiq rest client work correctly
pull/40279/merge
Tim Rupp 6 years ago committed by GitHub
parent 548282139f
commit 5e7878a6a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -62,7 +62,9 @@ class F5Client(F5BaseClient):
class F5RestClient(F5BaseClient):
def __init__(self, *args, **kwargs):
super(F5RestClient, self).__init__(*args, **kwargs)
params = kwargs.get('module').params
module = kwargs.pop('module')
super(F5RestClient, self).__init__(module=module, **params)
self.provider = self.merge_provider_params()
@property

@ -434,7 +434,7 @@ class F5BaseClient(object):
elif os.environ.get('ANSIBLE_NET_USERNAME', None):
result['user'] = os.environ.get('ANSIBLE_NET_USERNAME', None)
else:
result['user'] = True
result['user'] = None
if provider.get('password', None):
result['password'] = provider.get('password', None)
@ -445,7 +445,7 @@ class F5BaseClient(object):
elif os.environ.get('ANSIBLE_NET_PASSWORD', None):
result['password'] = os.environ.get('ANSIBLE_NET_PASSWORD', None)
else:
result['password'] = True
result['password'] = None
if result['validate_certs'] in BOOLEANS_TRUE:
result['validate_certs'] = True

@ -73,9 +73,11 @@ class ActionModule(_ActionModule):
socket_path = connection.run()
display.vvvv('socket_path: %s' % socket_path, pc.remote_addr)
if not socket_path:
return {'failed': True,
'msg': 'Unable to open shell. Please see: ' +
'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell'}
return {
'failed': True,
'msg': 'Unable to open shell. Please see: '
'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell'
}
task_vars['ansible_socket'] = socket_path
else:

@ -74,7 +74,7 @@ class ActionModule(_ActionModule):
display.vvvv('socket_path: %s' % socket_path, pc.remote_addr)
if not socket_path:
return {'failed': True,
'msg': 'unable to open shell. Please see: ' +
'msg': 'Unable to open shell. Please see: '
'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell'}
task_vars['ansible_socket'] = socket_path

@ -51,10 +51,12 @@ class TerminalModule(TerminalBase):
def on_open_shell(self):
try:
self._exec_cli_command(b'modify cli preference display-threshold 0 pager disabled')
self._exec_cli_command(b'run /util bash -c "stty cols 1000000" 2> /dev/null')
except AnsibleConnectionFailure as ex:
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')
self._exec_cli_command(b'stty cols 1000000 2> /dev/null')
except AnsibleConnectionFailure as ex:
raise AnsibleConnectionFailure('unable to set terminal parameters')

Loading…
Cancel
Save