]> git.ipfire.org Git - location/libloc.git/commitdiff
importer: Actually perform the Spamhaus sanity check
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Aug 2022 13:47:08 +0000 (13:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Aug 2022 13:47:08 +0000 (13:47 +0000)
The check block was indented incorrectly and would have never been
executed.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 083acb6ee63b4e9fda2d8f74ad6ea9a145430c53..1af5442a1f18963ead493fc0972a624115caff7c 100644 (file)
@@ -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...