mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
marker: make per-filter toggle a no-op when the marker isn't installed
_ubridge_set_marker_filter_state raised "Marker X is not installed on this node" when the capture node wasn't running — the name->bridge map is only populated during _ubridge_apply_markers, which runs when the node is up. The error was noise: the controller's enabled-only short-circuit catches it and falls back, and the controller-layer enabled is authoritative (honoured when the node starts and applies the marker). Treat a missing entry as a no-op instead of raising.
This commit is contained in:
2 files changed
+8
-2
No files matched your search
@@ -1197,7 +1197,11 @@ class BaseNode:
|
||||
|
||||
bridge_name = self._marker_filter_bridges.get(name)
|
||||
if not bridge_name:
|
||||
raise UbridgeError(f"Marker '{name}' is not installed on this node")
|
||||
# Marker not installed on this uBridge (node not started, or not yet
|
||||
# applied). The controller-layer `enabled` is still authoritative and
|
||||
# is honoured when the node starts and applies the marker, so a
|
||||
# toggle here is a no-op rather than an error.
|
||||
return
|
||||
state = "on" if enabled else "off"
|
||||
await self._ubridge_send(f"bridge enable_packet_filter {bridge_name} {name} {state}")
|
||||
|
||||
|
||||
Reference in new issue
Block a user