From e722b6fa0f4985faf401cd2cb75c2e85d8d69721 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Thu, 10 May 2018 04:36:46 -0700 Subject: [PATCH] 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 --- vmware_nsxlib/v3/cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmware_nsxlib/v3/cluster.py b/vmware_nsxlib/v3/cluster.py index 219e46ee..ad11551f 100644 --- a/vmware_nsxlib/v3/cluster.py +++ b/vmware_nsxlib/v3/cluster.py @@ -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