From: Michael Tremer Date: Mon, 4 Mar 2024 10:29:38 +0000 (+0000) Subject: importer: Add option to only import specific RIRs X-Git-Tag: 0.9.18~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d77d05d1025ff803ea22419edcb2b3a24734f45a;p=location%2Flibloc.git importer: Add option to only import specific RIRs Signed-off-by: Michael Tremer --- diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index 080b776..41ff72c 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -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("""