mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-01 04:30:22 -07:00
Pull persistent connection parameters via get_option (#39367)
* WIP Pull persistent connection parameters via get_option * Fix pep8 * Add use_persistent_connection setting to paramiko_ssh plugin * Add vars section to persistent_command_timeout setting and prevail provider values over config manager * Use persistent_command_timeout on network_cli instead of timeout * Fix unit tests If we don't call loader to get network_cli, then _load_name is never set and we get KeyError. * Pull persistent_command_timeout via config manager for ios connection local * Pull persistent_command_timeout via config manager on connection local
This commit is contained in:
parent
865f2c5990
commit
62e1c14edc
12 changed files with 64 additions and 22 deletions
|
@ -72,11 +72,14 @@ class ActionModule(_ActionModule):
|
|||
pc.remote_user = provider['username'] or self._play_context.connection_user
|
||||
pc.password = provider['password'] or self._play_context.password
|
||||
pc.private_key_file = provider['ssh_keyfile'] or self._play_context.private_key_file
|
||||
pc.timeout = int(provider['timeout'] or C.PERSISTENT_COMMAND_TIMEOUT)
|
||||
pc.timeout = int(provider['timeout']) if provider['timeout'] else None
|
||||
|
||||
display.vvv('using connection plugin %s (was local)' % pc.connection, pc.remote_addr)
|
||||
connection = self._shared_loader_obj.connection_loader.get('persistent', pc, sys.stdin)
|
||||
|
||||
if connection._play_context.timeout is None:
|
||||
connection._play_context.timeout = connection.get_option('persistent_command_timeout')
|
||||
|
||||
socket_path = connection.run()
|
||||
display.vvvv('socket_path: %s' % socket_path, pc.remote_addr)
|
||||
if not socket_path:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue