From 555c6ce53e90ee7adf8f036bc1a17dbf932f1008 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 22 May 2020 18:57:13 +0800 Subject: [PATCH] update roa.py for external asn check --- scripts/roa.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/roa.py b/scripts/roa.py index 9248dc7..7f0bbcc 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -113,12 +113,13 @@ def neonet_get_asns(): if not f.is_file(): continue fc = shell2dict(f.read_text()) - present_keys = ('name', 'owner', 'desc') + present_keys = ('name', 'owner', 'desc', 'external') + required_keys = ('name', 'owner') asn = str2asn(f.name, 1) asns[asn] = {k: fc.get(k) for k in present_keys} assert fc.get('owner') in PEOPLE - for v in asns[asn].values(): - assert v is not None + for k in required_keys: + assert asns[asn].get(k) # required fields missing assert AS_IS_NEONET(asn) or asns[asn].get('external') except Exception: print("[!] Error while processing file", f)