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:
Deepak Agrawal 2018-07-23 07:07:06 +05:30 committed by GitHub
commit 20769de560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -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):