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: Mon, 12 Apr 2021 10:21:11 +0100 Message-ID: <398AB96C-EF76-4DD8-BC5B-77066B2F7ABB@ipfire.org> In-Reply-To: <9bf1597e-700e-75c5-c9eb-30e546da92ec@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3533418149673256385==" List-Id: --===============3533418149673256385== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, How about we add the country to the list and mark the continent with a =E2=80= =9C-=E2=80=9C: AF AS Afghanistan YU - Yugoslavia -Michael > On 10 Apr 2021, at 13:32, Peter M=C3=BCller wr= ote: >=20 > Hello Michael, >=20 > thanks for your reply. >=20 > Yes, having this configurable in countries.txt would be nice indeed. Do you= propose a certain syntax for this? >=20 > And yes, a tuple is a better idea here. I will wait for your reply and subm= it a second version of this patch then. >=20 > Thanks, and best regards, > Peter M=C3=BCller >=20 >=20 >> 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 w= rote: >>>=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= .html >>>=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-import= er.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= inetnum.get("country") in ["AQ", "BV"]): >>> log.warning("Skipping network with bogus country '%s': %s" % \ >>> (inetnum.get("country"), inetnum.get("inet6num") or inetnum.get("inet= num"))) >>> return >>> --=20 >>> 2.26.2 >>=20 --===============3533418149673256385==--