From: Michael Tremer Date: Sat, 2 Mar 2024 09:50:23 +0000 (+0000) Subject: importer: Import AWS IP feed into the new feeds table X-Git-Tag: 0.9.18~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0573b04e106448be83cef0880dc9fb579e29ffa;p=location%2Flibloc.git importer: Import AWS IP feed into the new feeds table Signed-off-by: Michael Tremer --- diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index dfdc79a..c27634c 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -1705,7 +1705,7 @@ class CLI(object): # At this point, we can assume the downloaded file to be valid self.db.execute(""" - DELETE FROM network_overrides WHERE source = 'Amazon AWS IP feed'; + DELETE FROM network_feeds WHERE source = 'Amazon AWS IP feed' """) # XXX: Set up a dictionary for mapping a region name to a country. Unfortunately, @@ -1793,24 +1793,22 @@ class CLI(object): # Conduct SQL statement... self.db.execute(""" - INSERT INTO network_overrides( + INSERT INTO + network_feeds + ( network, - country, source, - is_anonymous_proxy, - is_satellite_provider, + country, is_anycast - ) VALUES (%s, %s, %s, %s, %s, %s) - ON CONFLICT (network) DO NOTHING""", - "%s" % network, - cc, - "Amazon AWS IP feed", - None, - None, - is_anycast, + ) + VALUES + ( + %s, %s, %s, %s + ) + ON CONFLICT (network, source) DO NOTHING + """, "%s" % network, "Amazon AWS IP feed", cc, is_anycast, ) - def _update_feed_for_spamhaus_drop(self): downloader = location.importer.Downloader()