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): ...@@ -1393,15 +1393,16 @@ class CLI(object):
log.error("Unable to download Spamhaus DROP URL %s: %s" % (url, e)) log.error("Unable to download Spamhaus DROP URL %s: %s" % (url, e))
return return
# Conduct a very basic sanity check to rule out CDN issues causing bogus DROP # Conduct a very basic sanity check to rule out CDN issues causing bogus DROP
# downloads. # downloads.
if len(fcontent) > 10: if len(fcontent) > 10:
self.db.execute(""" self.db.execute("""
DELETE FROM autnum_overrides WHERE source = 'Spamhaus ASN-DROP list'; DELETE FROM autnum_overrides WHERE source = 'Spamhaus ASN-DROP list';
DELETE FROM network_overrides WHERE source = 'Spamhaus DROP lists'; DELETE FROM network_overrides WHERE source = 'Spamhaus DROP lists';
""") """)
else: else:
log.error("Spamhaus DROP URL %s returned likely bogus file, ignored" % url) log.error("Spamhaus DROP URL %s returned likely bogus file, ignored" % url)
continue
# Iterate through every line, filter comments and add remaining networks to # Iterate through every line, filter comments and add remaining networks to
# the override table in case they are valid... # 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