1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix persistent reset_connection issue (#33590)

Fixes #33589

If persistent socket does not exist catch the execption
and ignore it as the coneection is already closed.
This commit is contained in:
Ganesh Nalawade 2017-12-06 19:37:09 +05:30 committed by GitHub
parent 666692069d
commit dfd68e4966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -913,8 +913,12 @@ class StrategyBase:
play_context.set_options_from_plugin(connection)
if connection:
connection.reset()
msg = 'reset connection'
try:
connection.reset()
msg = 'reset connection'
except ConnectionError as e:
# most likely socket is already closed
display.debug("got an error while closing persistent connection: %s" % e)
else:
msg = 'no connection, nothing to reset'
else: