logger.debug("Fetching instances for domain='%s',software='%s'", domain, software)
peerlist = fetch_peers(domain, software)
+ logger.debug("peerlist[]='%s'", type(peerlist))
+ if isinstance(peerlist, list):
+ logger.debug("Invoking instances.set_total_peerlist(%s,%d) ...", domain, len(peerlist))
+ instances.set_total_peers(domain, peerlist)
+
if peerlist is None:
logger.warning("Cannot fetch peers: domain='%s'", domain)
return
# Skip "None" types as tidup.domain() cannot parse them
continue
- logger.debug("instance='%s' - BEFORE", instance)
+ logger.debug("instance='%s' - BEFORE!", instance)
instance = tidyup.domain(instance)
- logger.debug("instance='%s' - AFTER", instance)
+ logger.debug("instance='%s' - AFTER!", instance)
if instance == "":
logger.warning("Empty instance after tidyup.domain(), domain='%s'", domain)
logger.warning("Exception during fetching JSON: domain='%s',exception[%s]:'%s'", domain, type(exception), str(exception))
instances.set_last_error(domain, exception)
- logger.debug("Adding %d for domain='%s'", len(peers), domain)
- instances.set_total_peers(domain, peers)
-
logger.debug("peers()=%d - EXIT!", len(peers))
return peers
logger.debug("Host returned same set of %d instance(s) - BREAK!", already)
break
- logger.debug("Adding %d for domain='%s'", len(peers), domain)
- instances.set_total_peers(domain, peers)
-
logger.debug("peers()=%d - EXIT!", len(peers))
return peers
logger.warning("domain='%s' causes error during API query: '%s' - SKIPPED!", domain, data['error_message'])
break
- logger.debug("Adding %d peers for domain='%s'", len(peers), domain)
- instances.set_total_peers(domain, peers)
-
logger.debug("Returning peers[]='%s' - EXIT!", type(peers))
return peers