From 841e1d015a8fe3275f1492b1d40e1fa6b2bb6dee Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Mon, 15 Jun 2020 03:14:09 +0200 Subject: [PATCH] Protect crawl converter against broken crawls Some crawls don't contain all ASNs. As we only want to convert the crawl and not add additional information we just skip adding stub info for non-existant ASNs. --- backend/crawler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/crawler.py b/backend/crawler.py index 992c457..c7d94dd 100644 --- a/backend/crawler.py +++ b/backend/crawler.py @@ -199,7 +199,7 @@ def convert_crawl(crawl): if path: net.nodes[path[-1]]['prefixes'].add(prefix) for path_asn in path: - if path_asn not in (path[-1], path[0]): + if path_asn in net.nodes and path_asn not in (path[-1], path[0]): net.nodes[path_asn]['stub'] = False # add neighbor count