mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-12-26 11:39:23 +08:00
fix roa
This commit is contained in:
parent
555c6ce53e
commit
37f3cb5ebe
1 changed files with 5 additions and 3 deletions
|
@ -113,14 +113,16 @@ def neonet_get_asns():
|
||||||
if not f.is_file():
|
if not f.is_file():
|
||||||
continue
|
continue
|
||||||
fc = shell2dict(f.read_text())
|
fc = shell2dict(f.read_text())
|
||||||
present_keys = ('name', 'owner', 'desc', 'external')
|
present_keys = ('name', 'owner', 'desc', 'source')
|
||||||
required_keys = ('name', 'owner')
|
required_keys = ('name', 'owner', 'source')
|
||||||
asn = str2asn(f.name, 1)
|
asn = str2asn(f.name, 1)
|
||||||
asns[asn] = {k: fc.get(k) for k in present_keys}
|
asns[asn] = {k: fc.get(k) for k in present_keys}
|
||||||
assert fc.get('owner') in PEOPLE
|
assert fc.get('owner') in PEOPLE
|
||||||
for k in required_keys:
|
for k in required_keys:
|
||||||
assert asns[asn].get(k) # required fields missing
|
assert asns[asn].get(k) # required fields missing
|
||||||
assert AS_IS_NEONET(asn) or asns[asn].get('external')
|
as_src = asns[asn].get('source')
|
||||||
|
assert as_src in ('NeoNetwork', 'DN42', 'INET')
|
||||||
|
assert AS_IS_NEONET(asn) or as_src != 'NeoNetwork'
|
||||||
except Exception:
|
except Exception:
|
||||||
print("[!] Error while processing file", f)
|
print("[!] Error while processing file", f)
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in a new issue