Skip to content

Commit bdbbe24

Browse files
committed
fix: work correctly for routers with a single ixp session
1 parent e39711d commit bdbbe24

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

wanda/filter_list_generation.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pathlib
22
import platform
3+
from collections import defaultdict
34
from multiprocessing.pool import Pool
45

56
from wanda.as_filter.as_filter import ASFilter
@@ -88,9 +89,6 @@ def main_customer_filter_lists(
8889
router_per_as[router_hostname] = {asn}
8990

9091
for ixp in ixp_list:
91-
if ixp['is_route_server']:
92-
continue
93-
9492
fc = list(filter(lambda c: c['id'] == ixp['ixp_connection']['id'], connections))
9593
connection = fc[0]
9694

@@ -100,6 +98,11 @@ def main_customer_filter_lists(
10098
if hosts and router_hostname not in hosts:
10199
continue
102100

101+
if ixp['is_route_server']:
102+
if router_hostname not in router_per_as:
103+
router_per_as[router_hostname] = {}
104+
continue
105+
103106
enabled_asn.add(asn)
104107

105108
tag_list = map(lambda x: x['name'], ixp['tags'])
@@ -135,7 +138,7 @@ def main_customer_filter_lists(
135138
n_worker = max_threads
136139
l.warning(f"Running with a limited amount of threads, n_worker={max_threads}")
137140
elif system_platform == "Linux":
138-
n_worker = len(prepared_asns)
141+
n_worker = max(len(prepared_asns), 1)
139142
else:
140143
l.warning("Running with a limited amount of threads due to OS limitations...")
141144
n_worker = 8

0 commit comments

Comments
 (0)