]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 18 May 2023 04:32:41 +0000 (06:32 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 18 May 2023 04:32:41 +0000 (06:32 +0200)
- more debug lines added

fetch_blocks.py

index c11710e4f1ac759ae1581cab26fb315cd4b48e6c..193969a67766c1e1af79dbd30803a8f3244c2462 100644 (file)
@@ -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)