mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 22:30:22 -07:00
Don't close persistent connection socket on command timeout (#43071)
* Don't close persistent connection socket on command timeout * handle exception in client of ansible-connection instead removing socket removal
This commit is contained in:
parent
8c620a17d4
commit
20769de560
2 changed files with 13 additions and 6 deletions
|
@ -122,7 +122,11 @@ def to_commands(module, commands):
|
|||
|
||||
def run_commands(module, commands, check_rc=True):
|
||||
connection = get_connection(module)
|
||||
return connection.run_commands(commands=commands, check_rc=check_rc)
|
||||
try:
|
||||
out = connection.run_commands(commands=commands, check_rc=check_rc)
|
||||
return out
|
||||
except ConnectionError as exc:
|
||||
module.fail_json(msg=to_text(exc))
|
||||
|
||||
|
||||
def load_config(module, commands):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue