From: Michael Tremer Date: Tue, 30 Jan 2018 15:47:54 +0000 (+0000) Subject: Ensure that country codes are uppercase and fix some bugs in the ARIN database X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=768c4a418c661a629c46b795264d87b0a1f0a46a;p=location%2Flocation-database.git Ensure that country codes are uppercase and fix some bugs in the ARIN database Signed-off-by: Michael Tremer --- diff --git a/tools/base.py b/tools/base.py index f2b4bbe..7cfea8c 100644 --- a/tools/base.py +++ b/tools/base.py @@ -278,9 +278,15 @@ class RIRParser(object): inetnum[key] = val - elif key in ("netname", "country"): + elif key == "netname": inetnum[key] = val + elif key == "country": + if val == "UNITED STATES": + val = "US" + + inetnum[key] = val.upper() + elif key == "descr": if key in inetnum: inetnum[key] += "\n%s" % val