diff options
author | Rob Austein <sra@hactrn.net> | 2012-05-05 06:08:16 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2012-05-05 06:08:16 +0000 |
commit | c151cd5c3405b73279809b9107651d5bfbc21338 (patch) | |
tree | dee8a162de600127fd0ca748abe3d3a72345100b /scripts | |
parent | 93da6a888c1a1f27c6cf7bd23adcd58199644a63 (diff) |
Use lowercase handle names for RIRs, for consistancy with older code.
svn path=/branches/tk33/; revision=4469
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/arin-to-csv.py | 24 | ||||
-rw-r--r-- | scripts/iana-to-csv.py | 8 |
2 files changed, 16 insertions, 16 deletions
diff --git a/scripts/arin-to-csv.py b/scripts/arin-to-csv.py index 63368723..dcb508ff 100644 --- a/scripts/arin-to-csv.py +++ b/scripts/arin-to-csv.py @@ -56,18 +56,18 @@ def do_asn(node): find(node, tag_endAsNumber)))) erx_table = { - "AF" : "AFRINIC", - "AP" : "APNIC", - "AR" : "ARIN", - "AV" : "ARIN", - "FX" : "AFRINIC", - "LN" : "LACNIC", - "LX" : "LACNIC", - "PV" : "APNIC", - "PX" : "APNIC", - "RN" : "RIPE", - "RV" : "RIPE", - "RX" : "RIPE" } + "AF" : "afrinic", + "AP" : "apnic", + "AR" : "arin", + "AV" : "arin", + "FX" : "afrinic", + "LN" : "lacnic", + "LX" : "lacnic", + "PV" : "apnic", + "PX" : "apnic", + "RN" : "ripe", + "RV" : "ripe", + "RX" : "ripe" } def do_net(node): handle = find(node, tag_orgHandle) 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) |