diff --git a/novajoin/ipa.py b/novajoin/ipa.py index 42ae81c..f5f2497 100644 --- a/novajoin/ipa.py +++ b/novajoin/ipa.py @@ -17,6 +17,9 @@ import os import time import uuid +from six.moves import http_client + + try: from gssapi.exceptions import GSSError from ipalib import api @@ -161,6 +164,13 @@ class IPANovaJoinBase(object): tries += 1 if self.backoff: self.__backoff() + 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() + tries += 1 + if self.backoff: + self.__backoff() else: return