From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: location@lists.ipfire.org Subject: Re: [PATCH] location-importer.in: treat AQ and BV as invalid countries Date: Wed, 07 Apr 2021 21:49:55 +0100 Message-ID: <93558C7B-5242-40FD-8BBD-216DE846067D@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4101203159415128838==" List-Id: --===============4101203159415128838== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, * would we not want this to be configurable in countries.txt? * The list should probably be a tuple. -Michael > On 1 Apr 2021, at 20:57, Peter M=C3=BCller wro= te: >=20 > 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. >=20 > 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. >=20 > Therefore, this patch skips any network object that has either AQ or BV > country code set. >=20 > See also: https://lists.ipfire.org/pipermail/location/2020-October/000199.h= tml >=20 > Signed-off-by: Peter M=C3=BCller > --- > src/python/location-importer.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/src/python/location-importer.in b/src/python/location-importer= .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 >=20 > # 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 i= netnum.get("country") in ["AQ", "BV"]): > log.warning("Skipping network with bogus country '%s': %s" % \ > (inetnum.get("country"), inetnum.get("inet6num") or inetnum.get("inetnu= m"))) > return > --=20 > 2.26.2 --===============4101203159415128838==--