From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: location@lists.ipfire.org Subject: Re: [PATCH] location-importer.in: treat AQ and BV as invalid countries Date: Sat, 10 Apr 2021 14:32:05 +0200 Message-ID: <9bf1597e-700e-75c5-c9eb-30e546da92ec@ipfire.org> In-Reply-To: <93558C7B-5242-40FD-8BBD-216DE846067D@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3525782080840751883==" List-Id: --===============3525782080840751883== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Michael, thanks for your reply. Yes, having this configurable in countries.txt would be nice indeed. Do you p= ropose a certain syntax for this? And yes, a tuple is a better idea here. I will wait for your reply and submit= a second version of this patch then. Thanks, and best regards, Peter M=C3=BCller > Hello, >=20 > * would we not want this to be configurable in countries.txt? >=20 > * The list should probably be a tuple. >=20 > -Michael >=20 >> On 1 Apr 2021, at 20:57, Peter M=C3=BCller wr= ote: >> >> Both the Bouvet Island (BV) and Antarctica (AQ) are unpopulated at the >> time of writing. Network owners/operators putting these countries into >> their RIR data objects are either completely braindead or doing so for >> hostile reasons. >> >> While we might correct these locations to something useful by manually >> creating overrides for them, the rationale behind this patch is not to >> let these countries appear on productive systems in the first place, as >> we know they _cannot_ be true. >> >> Therefore, this patch skips any network object that has either AQ or BV >> country code set. >> >> See also: https://lists.ipfire.org/pipermail/location/2020-October/000199.= html >> >> Signed-off-by: Peter M=C3=BCller >> --- >> src/python/location-importer.in | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/src/python/location-importer.in b/src/python/location-importe= r.in >> index 1e08458..ac678dc 100644 >> --- a/src/python/location-importer.in >> +++ b/src/python/location-importer.in >> @@ -624,7 +624,7 @@ class CLI(object): >> return >> >> # Skip objects with unknown country codes >> - if validcountries and inetnum.get("country") not in validcountries: >> + if validcountries and (inetnum.get("country") not in validcountries or = inetnum.get("country") in ["AQ", "BV"]): >> log.warning("Skipping network with bogus country '%s': %s" % \ >> (inetnum.get("country"), inetnum.get("inet6num") or inetnum.get("inetn= um"))) >> return >> --=20 >> 2.26.2 >=20 --===============3525782080840751883==--