diff --git a/mnet/frr_topo.py b/mnet/frr_topo.py index f2efd57..2b00a7e 100644 --- a/mnet/frr_topo.py +++ b/mnet/frr_topo.py @@ -167,7 +167,6 @@ def __init__(self, name: str, default_ip: str, uplinks: list[dict[str,typing.Any for link in uplinks: entry = IPPoolEntry(network=link["nw"], ip1=link["ip1"], ip2=link["ip2"]) self.ip_pool.append(entry) - print(f"added pool entry {entry.network}") def stable_node(self) -> bool: """ @@ -444,6 +443,11 @@ def __init__(self, topo: NetxTopo, net: mininet.net.Mininet, stable_monitors: bo self.ground_stations: dict[str, GroundStation] = {} self.stable_monitors = stable_monitors + # Create monitoring DB file. + fd, self.db_file = tempfile.mkstemp(suffix=".sqlite") + open(fd, "r").close() + print(f"Master db file {self.db_file}") + for frr_router in topo.routers: self.nodes[frr_router.name] = frr_router self.routers[frr_router.name] = frr_router @@ -452,7 +456,6 @@ def __init__(self, topo: NetxTopo, net: mininet.net.Mininet, stable_monitors: bo self.ground_stations[ground_station.name] = ground_station self.stat_samples = [] - fd, self.db_file = tempfile.mkstemp(suffix=".sqlite") self.net = net self.stub_net = False # If net is none, we are running in a stub mode without mininet or FRR. @@ -460,10 +463,6 @@ def __init__(self, topo: NetxTopo, net: mininet.net.Mininet, stable_monitors: bo self.net = StubMininet() self.stub_net = True - # Create monitoring DB file. - open(fd, "r").close() - print(f"Master db file {self.db_file}") - def start_routers(self) -> None: # Populate master db file data = [] @@ -472,7 +471,7 @@ def start_routers(self) -> None: data.append((router.name, router.defaultIP(), router.stable_node())) # Not stable targets - don't monitor for station in self.ground_stations.values(): - data.append((station.name, station.defaultIP(), router.stable_node())) + data.append((station.name, station.defaultIP(), station.stable_node())) mnet.pmonitor.init_targets(self.db_file, data) # Start all nodes diff --git a/mnet/pmonitor.py b/mnet/pmonitor.py index 3640e12..7e9b8c8 100644 --- a/mnet/pmonitor.py +++ b/mnet/pmonitor.py @@ -182,8 +182,7 @@ def monitor_targets(db_path_master: str, db_path_local: str, address: str): if not TEST: time.sleep(5) running = can_run(db_master, address) - target_running = is_running(db_master, target[1]) - if running and target_running: + if running: sample_target(db_local, target[0], target[1]) if TEST: set_can_run(db_master, address, False)