1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-12-26 03:09:23 +08:00

duplicate asn

This commit is contained in:
JerryXiao 2020-05-02 15:12:09 +08:00
parent cf653edb6d
commit 160d4d76d2
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -192,12 +192,13 @@ if __name__ == "__main__":
for asn, asi in ASNS.items(): for asn, asi in ASNS.items():
as_route4 = list() as_route4 = list()
as_route6 = list() as_route6 = list()
vkeys = [k for k in VALID_KEYS if k != 'asn']
for r in roa4: for r in roa4:
if r['asn'] == asn: if r['asn'] == asn:
as_route4.append({k:v for k, v in r.items() if k in VALID_KEYS}) as_route4.append({k:v for k, v in r.items() if k in vkeys})
for r in roa6: for r in roa6:
if r['asn'] == asn: if r['asn'] == asn:
as_route6.append({k:v for k, v in r.items() if k in VALID_KEYS}) as_route6.append({k:v for k, v in r.items() if k in vkeys})
owner = asi['owner'] owner = asi['owner']
peopledict = d_output['people'].setdefault(owner, {"info": PEOPLE[owner], "asns": list()}) peopledict = d_output['people'].setdefault(owner, {"info": PEOPLE[owner], "asns": list()})
peopledict['asns'].append({"asn": asn, "routes": {'ipv4': as_route4, 'ipv6': as_route6}}) peopledict['asns'].append({"asn": asn, "routes": {'ipv4': as_route4, 'ipv6': as_route6}})