failure to connect may be a timeout

This commit is contained in:
Min RK
2016-03-04 11:08:43 +01:00
parent 4533d96002
commit 31be00b49f

View File

@@ -38,7 +38,7 @@ def can_connect(ip, port):
try:
socket.create_connection((ip, port))
except socket.error as e:
if e.errno != errno.ECONNREFUSED:
if e.errno not in {errno.ECONNREFUSED, errno.ETIMEDOUT}:
app_log.error("Unexpected error connecting to %s:%i %s",
ip, port, e
)