mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adds various fixes for f5 modules (#40208)
* Adds stty expansion for cli commands * minor fixes * Make bigiq rest client work correctly
This commit is contained in:
parent
548282139f
commit
5e7878a6a1
5 changed files with 13 additions and 7 deletions
|
@ -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…
Reference in a new issue