From 6d43a05e32f3e0d846810ba319cf1d004664746c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 2 Mar 2024 09:45:19 +0000 Subject: [PATCH] importer: Import Spamhaus DROP feeds into the new feeds table Signed-off-by: Michael Tremer --- src/scripts/location-importer.in | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index 878710d..dfdc79a 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -1835,7 +1835,7 @@ class CLI(object): # Conduct a very basic sanity check to rule out CDN issues causing bogus DROP # downloads. if len(fcontent) > 10: - self.db.execute("DELETE FROM network_overrides WHERE source = %s", name) + self.db.execute("DELETE FROM network_feeds WHERE source = %s", name) else: log.warning("%s (%s) returned likely bogus file, ignored" % (name, url)) continue @@ -1865,15 +1865,17 @@ class CLI(object): # Conduct SQL statement... self.db.execute(""" - INSERT INTO network_overrides( + INSERT INTO + network_feeds + ( network, source, is_drop - ) VALUES (%s, %s, %s) - ON CONFLICT (network) DO UPDATE SET is_drop = True""", - "%s" % network, - name, - True + ) + VALUES + ( + %s, %s, %s + )""", "%s" % network, name, True, ) for name, url in asn_lists: -- 2.47.2