From d77d05d1025ff803ea22419edcb2b3a24734f45a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 4 Mar 2024 10:29:38 +0000 Subject: [PATCH] importer: Add option to only import specific RIRs Signed-off-by: Michael Tremer --- src/scripts/location-importer.in | 6 ++++++ 1 file changed, 6 insertions(+) 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(""" -- 2.47.2