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.
This commit is contained in:
Sebastian Lohff 2020-06-15 03:14:09 +02:00
parent b506c7c8a2
commit 841e1d015a
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ def convert_crawl(crawl):
if path: if path:
net.nodes[path[-1]]['prefixes'].add(prefix) net.nodes[path[-1]]['prefixes'].add(prefix)
for path_asn in path: 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 net.nodes[path_asn]['stub'] = False
# add neighbor count # add neighbor count