Commit aa23e03d authored by Michael Tremer's avatar Michael Tremer

importer: Actually perform the Spamhaus sanity check

The check block was indented incorrectly and would have never been
executed.
Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 95e363ea
......@@ -1393,15 +1393,16 @@ class CLI(object):
log.error("Unable to download Spamhaus DROP URL %s: %s" % (url, e))
return
# Conduct a very basic sanity check to rule out CDN issues causing bogus DROP
# downloads.
if len(fcontent) > 10:
self.db.execute("""
DELETE FROM autnum_overrides WHERE source = 'Spamhaus ASN-DROP list';
DELETE FROM network_overrides WHERE source = 'Spamhaus DROP lists';
""")
else:
log.error("Spamhaus DROP URL %s returned likely bogus file, ignored" % url)
# Conduct a very basic sanity check to rule out CDN issues causing bogus DROP
# downloads.
if len(fcontent) > 10:
self.db.execute("""
DELETE FROM autnum_overrides WHERE source = 'Spamhaus ASN-DROP list';
DELETE FROM network_overrides WHERE source = 'Spamhaus DROP lists';
""")
else:
log.error("Spamhaus DROP URL %s returned likely bogus file, ignored" % url)
continue
# Iterate through every line, filter comments and add remaining networks to
# the override table in case they are valid...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment