mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-11-25 22:40:41 +08:00
roa.py: minor change
This commit is contained in:
parent
066454d450
commit
5ef859bf24
1 changed files with 4 additions and 6 deletions
|
@ -193,12 +193,10 @@ if __name__ == "__main__":
|
||||||
as_route4 = list()
|
as_route4 = list()
|
||||||
as_route6 = list()
|
as_route6 = list()
|
||||||
vkeys = [k for k in VALID_KEYS if k != 'asn']
|
vkeys = [k for k in VALID_KEYS if k != 'asn']
|
||||||
for r in roa4:
|
for roa, as_route in ((roa4, as_route4), (roa6, as_route6)):
|
||||||
if r['asn'] == asn:
|
for r in roa:
|
||||||
as_route4.append({k:v for k, v in r.items() if k in vkeys})
|
if r['asn'] == asn:
|
||||||
for r in roa6:
|
as_route.append({k:v for k, v in r.items() if k in vkeys})
|
||||||
if r['asn'] == asn:
|
|
||||||
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}})
|
||||||
|
|
Loading…
Reference in a new issue