Retry is IOError is received

In envs where the access is very slow a IOError may be received
insetad of OpenSSL.SSL.Error. Here we perform a retry.

Change-Id: Ib70eaabf94cd637ca68d311a7944687bf52d7bc9
This commit is contained in:
Gary Kotton 2018-05-10 04:36:46 -07:00
parent 4f7c1a5c6d
commit e722b6fa0f
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class TimeoutSession(requests.Session):
def request_with_retry_on_ssl_error(*args, **kwargs):
try:
return super(TimeoutSession, self).request(*args, **kwargs)
except OpenSSL.SSL.Error:
except (IOError, OpenSSL.SSL.Error):
# This can happen when connection tries to access certificate
# file it was opened with (renegotiation?)
# Proper way to solve this would be to pass in-memory cert