]> git.ipfire.org Git - location/libloc.git/commitdiff
location-importer: Replace "UK" with "GB"
authorPeter Müller <peter.mueller@ipfire.org>
Sun, 12 Dec 2021 09:11:43 +0000 (10:11 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 13 Dec 2021 17:46:35 +0000 (17:46 +0000)
Apparently, LACNIC does not to proper input validation on supplied
country codes, so people can use "UK", while they probably mean "GB"
instead.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-importer.in

index 4373e41517caeb3b885471f199e9555ae406dbef..118b0de294370728298c93e5c78e19fcfbc01384 100644 (file)
@@ -734,6 +734,10 @@ class CLI(object):
                                                # ... but keep this list distinct...
                                                continue
 
+                               # When people set country codes to "UK", they actually mean "GB"
+                               if val == "UK":
+                                       val = "GB"
+
                                inetnum[key].append(val)
 
                # Skip empty objects