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

Catch socket errors so if you control-c a playbook it does not traceback

This commit is contained in:
Michael DeHaan 2012-08-08 21:19:20 -04:00
parent 33bc2610fa
commit 40ff3eb106

View file

@ -28,6 +28,7 @@ import base64
import getpass
import codecs
import collections
import socket
import re
import ansible.constants as C
@ -741,8 +742,11 @@ class Runner(object):
worker.join()
results = []
while not result_queue.empty():
results.append(result_queue.get(block=False))
try:
while not result_queue.empty():
results.append(result_queue.get(block=False))
except socket.error:
raise errors.AnsibleError("<interrupted>")
return results
# *****************************************************