Reconnect on httplib.ResponseNotReady

In CI we get a random ResponseNotReady exception,
which is caused by the server closing the keepalive socket.
This will close and retry the connection.
This patch adds this reconnect in a second place that was missed.

Change-Id: I745aea8dcb51598ca7d7a371dce66c7dd6ae8005
This commit is contained in:
Grzegorz Grasza 2018-12-02 17:02:17 +01:00
parent 85b776bc86
commit f8036d01a5
1 changed files with 8 additions and 0 deletions

View File

@ -224,6 +224,14 @@ class IPANovaJoinBase(object):
self.__backoff()
else:
raise
except http_client.ResponseNotReady:
# NOTE(xek): This means that the server closed the socket,
# so keep-alive ended and we can't use that connection.
api.Backend.rpcclient.disconnect()
if self.backoff:
self.__backoff()
else:
raise
def _ipa_client_configured(self):
"""Determine if the machine is an enrolled IPA client.