]> git.ipfire.org Git - location/libloc.git/commitdiff
importer: Add option to only import specific RIRs
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 10:29:38 +0000 (10:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 10:29:38 +0000 (10:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 080b776c909e7045914c525d2c9440939aa7422c..41ff72cb827b60450fa9ecc6affb0668b4427d47 100644 (file)
@@ -104,6 +104,8 @@ class CLI(object):
 
                # Update WHOIS
                update_whois = subparsers.add_parser("update-whois", help=_("Update WHOIS Information"))
+               update_whois.add_argument("sources", nargs="*",
+                       help=_("Only update these sources"))
                update_whois.set_defaults(func=self.handle_update_whois)
 
                # Update announcements
@@ -702,6 +704,10 @@ class CLI(object):
 
                # Iterate over all potential sources
                for source in sorted(location.importer.SOURCES):
+                       # Skip anything that should not be updated
+                       if ns.sources and not source in ns.sources:
+                               continue
+
                        with self.db.transaction():
                                # Create some temporary tables to store parsed data
                                self.db.execute("""