diff --git a/sat/memory/disco.py b/sat/memory/disco.py index ceebc0ac..669abe30 100755 --- a/sat/memory/disco.py +++ b/sat/memory/disco.py @@ -189,21 +189,25 @@ class Discovery(object): def infosEb(fail): if fail.check(defer.CancelledError): reason = u"request time-out" + fail = failure.Failure(exceptions.TimeOutError(fail.message)) else: try: reason = unicode(fail.value) except AttributeError: reason = unicode(fail) - log.warning( - u"Error while requesting disco infos from {jid}: {reason}".format( - jid=jid_.full(), reason=reason - ) + + log.warning( + u"Error while requesting disco infos from {jid}: {reason}".format( + jid=jid_.full(), reason=reason ) + ) + + # XXX we set empty disco in cache, to avoid getting an error or waiting + # for a timeout again the next time self.host.memory.updateEntityData( jid_, C.ENTITY_CAP_HASH, CAP_HASH_ERROR, profile_key=client.profile ) - disco_infos = self.hashes[CAP_HASH_ERROR] - return disco_infos + raise fail d = client.disco.requestInfo(jid_, nodeIdentifier=node) d.addCallback(infosCb)