]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
importer: Import AWS IP feed into the new feeds table
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Mar 2024 09:50:23 +0000 (09:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Mar 2024 09:50:23 +0000 (09:50 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index dfdc79a31c5dbbb7d0a0bf96f62af3055aa7facd..c27634cd29d41086d03dd1891dc8010fb9c54069 100644 (file)
@@ -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()