From 53065150c42d6d0ec03e2a92c4e2cbae9dbcc43b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 May 2023 06:32:41 +0200 Subject: [PATCH] Continued: - more debug lines added --- fetch_blocks.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fetch_blocks.py b/fetch_blocks.py index c11710e..193969a 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -76,16 +76,21 @@ for blocker, software in fba.c.fetchall(): fba.update_last_seen(timestamp, blocker, blocked, block_level) fba.conn.commit() + # Reasons if "mrf_simple_info" in federation: + print("DEBUG: Found mrf_simple_info:", blocker) for block_level, info in ( {**federation["mrf_simple_info"], **(federation["quarantined_instances_info"] if "quarantined_instances_info" in federation else {})} ).items(): + print("DEBUG: block_level, info.items():", block_level, len(info.items())) for blocked, reason in info.items(): + print("DEBUG: BEFORE blocked:", blocked) blocked = fba.tidyup(blocked) + print("DEBUG: AFTER blocked:", blocked) if blocked == "": print("WARNING: blocked is empty after fba.tidyup():", blocker, block_level) @@ -101,10 +106,12 @@ for blocker, software in fba.c.fetchall(): if searchres != None: blocked = searchres[0] + print("DEBUG: Updating block reason:", blocker, blocked, reason["reason"]) fba.update_block_reason(reason["reason"], blocker, blocked, block_level) for entry in blockdict: if entry["blocked"] == blocked: + print("DEBUG: Updating entry reason:", blocked) entry["reason"] = reason["reason"] fba.conn.commit() @@ -213,6 +220,7 @@ for blocker, software in fba.c.fetchall(): fba.update_last_seen(timestamp, blocker, blocked if blocked.count("*") <= 1 else blocked_hash, block_level) if reason != '': + print("DEBUG: Updating block reason:", blocker, blocked, reason) fba.update_block_reason(reason, blocker, blocked if blocked.count("*") <= 1 else blocked_hash, block_level) fba.conn.commit() @@ -276,6 +284,7 @@ for blocker, software in fba.c.fetchall(): fba.update_last_seen(timestamp, blocker, blocked, block_level) if reason != '': + print("DEBUG: Updating block reason:", blocker, blocked, reason) fba.update_block_reason(reason, blocker, blocked, block_level) fba.conn.commit() @@ -342,11 +351,13 @@ for blocker, software in fba.c.fetchall(): if "public_comment" in peer: reason = peer["public_comment"] + print("DEBUG: Updating block reason:", blocker, blocked, reason) fba.update_block_reason(reason, blocker, blocked, "reject") for entry in blockdict: if entry["blocked"] == blocked: entry["reason"] = reason + fba.conn.commit() except Exception as e: print("error:", e, blocker, software) -- 2.39.5