Skip to content

Commit

Permalink
fix: work correctly for routers with a single ixp session
Browse files Browse the repository at this point in the history
  • Loading branch information
johannwagner committed Sep 27, 2024
1 parent e39711d commit bdbbe24
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions wanda/filter_list_generation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pathlib
import platform
from collections import defaultdict
from multiprocessing.pool import Pool

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

for ixp in ixp_list:
if ixp['is_route_server']:
continue

fc = list(filter(lambda c: c['id'] == ixp['ixp_connection']['id'], connections))
connection = fc[0]

Expand All @@ -100,6 +98,11 @@ def main_customer_filter_lists(
if hosts and router_hostname not in hosts:
continue

if ixp['is_route_server']:
if router_hostname not in router_per_as:
router_per_as[router_hostname] = {}
continue

enabled_asn.add(asn)

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

0 comments on commit bdbbe24

Please sign in to comment.