From 9793b64b1a6842d965ad94fa4c0fa63c90f232ca Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 29 Aug 2020 23:32:03 +0800 Subject: [PATCH] roa.py: fix --- scripts/roa.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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