From aa23e03d682ce7d262e01f726f0921c5eec49d78 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 12 Aug 2022 13:47:08 +0000 Subject: [PATCH] importer: Actually perform the Spamhaus sanity check The check block was indented incorrectly and would have never been executed. Signed-off-by: Michael Tremer --- src/scripts/location-importer.in | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index 083acb6..1af5442 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -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... -- 2.39.5