From 06cd1dc7aa5c37a34c614226df4ae84659d4fbb0 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Tue, 30 Jun 2026 01:29:07 +0200 Subject: [PATCH] =?UTF-8?q?fix(get=5Fconfig):=20strip=20valid=5Flft/prefer?= =?UTF-8?q?red=5Flft=20=E2=80=94=20volatile=20DHCP=20fields=20cause=20fals?= =?UTF-8?q?e-positive=20config=20changes=20every=20poll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- napalm_linux/linux.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/napalm_linux/linux.py b/napalm_linux/linux.py index 8e8c95f..8f590f0 100644 --- a/napalm_linux/linux.py +++ b/napalm_linux/linux.py @@ -693,8 +693,17 @@ class LinuxDriver(OSDriver): def get_config( self, retrieve: str = "all", full: bool = False, sanitized: bool = False ) -> 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") + # 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": ""} # ------------------------------------------------------------------