]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 28 May 2023 14:34:57 +0000 (16:34 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 28 May 2023 14:34:57 +0000 (16:34 +0200)
- only a warning, 'activitypub-troll.cf' is to much rampant
- skip to next entry in case if being blacklisted or no 'host' found

fba.py

diff --git a/fba.py b/fba.py
index f92258048e9e5ad2f1a654acf9662b0d47a58359..e4dbe91f884b57d59f73c94f6fbacb593e7e9fee 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -389,13 +389,15 @@ def get_peers(domain: str, software: str) -> list:
             # Check records
             for row in fetched:
                 # DEBUG: print(f"DEBUG: row():{len(row)}")
-                if "host" in row and is_blacklisted(row["host"]):
-                    print(f"WARNING: row[host]='{row['host']}' is blacklisted. domain='{domain}'")
-                elif "host" in row:
-                    # DEBUG: print(f"DEBUG: Adding peer: '{row['host']}'")
-                    peers.append(row["host"])
-                else:
+                if not "host" in row:
                     print(f"WARNING: row()={len(row)} does not contain element 'host': {row},domain='{domain}'")
+                    continue
+                elif "host" in row and is_blacklisted(row["host"]):
+                    # DEBUG: print(f"DEBUG: row[host]='{row['host']}' is blacklisted. domain='{domain}'")
+                    continue
+
+                # DEBUG: print(f"DEBUG: Adding peer: '{row['host']}'")
+                peers.append(row["host"])
 
         # DEBUG: print("DEBUG: Returning peers[]:", type(peers))
         return peers