fix(get_config): strip valid_lft/preferred_lft — volatile DHCP fields cause false-positive config changes every poll

This commit is contained in:
Christian Manivong
2026-06-30 01:29:07 +02:00
parent 5fb51d23ea
commit 06cd1dc7aa
+10 -1
View File
@@ -693,8 +693,17 @@ class LinuxDriver(OSDriver):
def get_config( def get_config(
self, retrieve: str = "all", full: bool = False, sanitized: bool = False self, retrieve: str = "all", full: bool = False, sanitized: bool = False
) -> dict[str, Any]: ) -> dict[str, Any]:
"""Return minimal config representation (network interfaces only).""" """Return minimal config representation (network interfaces only).
``valid_lft`` / ``preferred_lft`` fields from DHCP leases are stripped
so the output is stable across polls and does not produce false-positive
config-change events in the config-backup feature.
"""
import re
running = self._send("ip addr show && ip route show") running = self._send("ip addr show && ip route show")
# Strip volatile DHCP lease timer fields — they decrement every poll
running = re.sub(r"\s+valid_lft\s+\S+\s+preferred_lft\s+\S+", "", running)
return {"running": running, "startup": "", "candidate": ""} return {"running": running, "startup": "", "candidate": ""}
# ------------------------------------------------------------------ # ------------------------------------------------------------------