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:
parent
666692069d
commit
dfd68e4966
1 changed files with 6 additions and 2 deletions
|
@ -913,8 +913,12 @@ class StrategyBase:
|
||||||
play_context.set_options_from_plugin(connection)
|
play_context.set_options_from_plugin(connection)
|
||||||
|
|
||||||
if connection:
|
if connection:
|
||||||
|
try:
|
||||||
connection.reset()
|
connection.reset()
|
||||||
msg = 'reset connection'
|
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:
|
else:
|
||||||
msg = 'no connection, nothing to reset'
|
msg = 'no connection, nothing to reset'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue