Browse Source

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.
Sebastian Lohff 1 year ago
parent
commit
841e1d015a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      backend/crawler.py

+ 1
- 1
backend/crawler.py View File

@@ -199,7 +199,7 @@ def convert_crawl(crawl):
199 199
             if path:
200 200
                 net.nodes[path[-1]]['prefixes'].add(prefix)
201 201
                 for path_asn in path:
202
-                    if path_asn not in (path[-1], path[0]):
202
+                    if path_asn in net.nodes and path_asn not in (path[-1], path[0]):
203 203
                         net.nodes[path_asn]['stub'] = False
204 204
 
205 205
     # add neighbor count

Loading…
Cancel
Save