From c151cd5c3405b73279809b9107651d5bfbc21338 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 5 May 2012 06:08:16 +0000 Subject: Use lowercase handle names for RIRs, for consistancy with older code. svn path=/branches/tk33/; revision=4469 --- scripts/iana-to-csv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/iana-to-csv.py') diff --git a/scripts/iana-to-csv.py b/scripts/iana-to-csv.py index a9aee0b9..ee8c53d1 100644 --- a/scripts/iana-to-csv.py +++ b/scripts/iana-to-csv.py @@ -37,10 +37,10 @@ tag_prefix = ns("prefix") tag_status = ns("status") handles = {} -rirs = { "LEGACY" : resource_bag() } +rirs = { "legacy" : resource_bag() } for rir in ("AfriNIC", "APNIC", "ARIN", "LACNIC", "RIPE NCC"): - handle = rir.split()[0].upper() + handle = rir.split()[0].lower() handles[rir] = handles["Assigned by %s" % rir] = handles["Administered by %s" % rir] = handle rirs[handle] = resource_bag() @@ -58,7 +58,7 @@ for record in iterate_xml("ipv4-address-space.xml", tag_record): prefix, prefixlen = [int(i) for i in record.findtext(tag_prefix).split("/")] if prefixlen != 8: raise ValueError("%s violated /8 assumption" % record.findtext(tag_prefix)) - rirs[handles.get(designation, "LEGACY")] |= resource_bag.from_str("%d.0.0.0/8" % prefix) + rirs[handles.get(designation, "legacy")] |= resource_bag.from_str("%d.0.0.0/8" % prefix) for record in iterate_xml("ipv6-unicast-address-assignments.xml", tag_record): description = record.findtext(tag_description) @@ -71,7 +71,7 @@ assert all(r in rirs for r, p in erx) erx_overrides = resource_bag.from_str(",".join(p for r, p in erx), allow_overlap = True) for rir in rirs: - if rir != "LEGACY": + if rir != "legacy": rirs[rir] -= erx_overrides rirs[rir] |= resource_bag.from_str(",".join(p for r, p in erx if r == rir), allow_overlap = True) -- cgit v1.2.3