sys.exit(255)
def block_instance(blocker: str, blocked: str, reason: str, block_level: str, first_added: int, last_seen: int):
+ if blocker.find("@") > 0:
+ print("WARNING: Bad blocker:", blocker)
+ raise
+ elif blocked.find("@") > 0:
+ print("WARNING: Bad blocked:", blocked)
+ raise
+
print("--- New block:", blocker, blocked, reason, block_level, first_added, last_seen)
try:
c.execute(
sys.exit(255)
def add_instance(domain: str):
+ if domain.find("@") > 0:
+ print("WARNING: Bad domain name:", domain)
+ raise
+
print("--- Adding new instance:", domain)
try:
c.execute(
peerlist = fba.get_peers(domain)
if (peerlist is None):
- print("FATAL: CANNOT FETCH PEERS:", domain)
+ print("ERROR: Cannot fetch peers:", domain)
return
for instance in peerlist:
instance = instance.lower()
+ if instance.find("@") > 0:
+ print("WARNING: Bad instance name,domain:", instance, domain)
+ continue
blacklisted = False
for domain in fba.blacklist: