diff --git a/scripts/roa.py b/scripts/roa.py index c2b3876..78e3ed8 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -123,7 +123,11 @@ def route_to_roa(asn_table: dict): if not net1["prefix"].overlaps(net2["prefix"]): continue entity_from_net = lambda net: asn_table.get(net["asn"])["owner"] - assert net1["prefix"] != net2["prefix"] or (net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2)) + try: + assert net1["prefix"] != net2["prefix"] + except AssertionError: + assert net1['asn'] != net2['asn'] and entity_from_net(net1) == entity_from_net(net2) + continue assert net1["prefix"].supernet_of(net2["prefix"]) s1net, s2net = (net1["supernet"], net2["supernet"]) assert s2net # please include supernet = in your route