try:
# Blocks
blockdict = list()
- json = fba.fetch_nodeinfo(domain, nodeinfo_url)
+ rows = fba.fetch_nodeinfo(domain, nodeinfo_url)
- if json is None:
+ if rows is None:
print("WARNING: Could not fetch nodeinfo from domain:", domain)
return
- elif not "metadata" in json:
- print(f"WARNING: json()={len(json)} does not have key 'metadata', domain='{domain}'")
+ elif not "metadata" in rows:
+ print(f"WARNING: rows()={len(rows)} does not have key 'metadata', domain='{domain}'")
return
- elif not "federation" in json["metadata"]:
- print(f"WARNING: json()={len(json['metadata'])} does not have key 'federation', domain='{domain}'")
+ elif not "federation" in rows["metadata"]:
+ print(f"WARNING: rows()={len(rows['metadata'])} does not have key 'federation', domain='{domain}'")
return
# DEBUG: print("DEBUG: Updating nodeinfo:", domain)
instances.update_last_nodeinfo(domain)
- federation = json["metadata"]["federation"]
+ federation = rows["metadata"]["federation"]
if "enabled" in federation:
# DEBUG: print("DEBUG: Instance has no block list to analyze:", domain)
# DEBUG: print("DEBUG: Updating block reason:", domain, blocked, reason["reason"])
blocks.update_reason(reason["reason"], domain, blocked, block_level)
- # DEBUG: print(f"DEBUG: blockdict()={count(blockdict)")
+ # DEBUG: print(f"DEBUG: blockdict()={len(blockdict)}")
for entry in blockdict:
if entry["blocked"] == blocked:
# DEBUG: print("DEBUG: Updating entry reason:", blocked)