From: Michael Tremer Date: Fri, 12 Aug 2022 13:47:08 +0000 (+0000) Subject: importer: Actually perform the Spamhaus sanity check X-Git-Tag: 0.9.14~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa23e03d682ce7d262e01f726f0921c5eec49d78;p=people%2Fms%2Flibloc.git importer: Actually perform the Spamhaus sanity check The check block was indented incorrectly and would have never been executed. Signed-off-by: Michael Tremer --- 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...