From fe7c3fc7f9703ac1caf1f1469937964ad202eebe Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Thu, 12 Nov 2026 15:28:25 +0100 Subject: [PATCH] fix(config): leave get_config to NAPALM's stub A VMG has no configuration export. The override returned {}, so a caller could not tell "not supported" from "read an empty configuration": netOrk took it for a backup that came back empty and raised config_backup_failed on every poll. Without the override NAPALM's stub raises NotImplementedError and the getter reads as not implemented. --- napalm_zyxel/zyxel_driver.py | 10 ---------- tests/test_zyxel.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/napalm_zyxel/zyxel_driver.py b/napalm_zyxel/zyxel_driver.py index 005aceb..aef4924 100644 --- a/napalm_zyxel/zyxel_driver.py +++ b/napalm_zyxel/zyxel_driver.py @@ -399,16 +399,6 @@ class ZyxelVMGDriver(ResidentialGatewayDriver): """Not supported on Zyxel VMG.""" return {} - def get_config( - self, - retrieve: str = "all", - full: bool = False, - sanitized: bool = False, - format: str = "text", - ) -> dict[str, Any]: - """Not supported on Zyxel VMG.""" - return {} - def get_environment(self) -> dict[str, Any]: """Not supported on Zyxel VMG.""" return {} diff --git a/tests/test_zyxel.py b/tests/test_zyxel.py index df6f1f3..ea942ca 100644 --- a/tests/test_zyxel.py +++ b/tests/test_zyxel.py @@ -423,9 +423,15 @@ class TestZyxelVMGDriver: assert result["MyWiFi"]["encryption"] == "WPA2" assert result["MyWiFi"]["clients"] == 3 - def test_get_config(self): - self._setup_mocked_http() - assert self.driver.get_config() == {} + def test_get_config_is_left_to_napalms_stub(self): + """A VMG has no configuration export: the driver must not override + get_config, so NAPALM's stub tells callers it is not supported. A stub + returning {} read as a backup that came back empty.""" + from napalm.base import NetworkDriver + + assert ZyxelVMGDriver.get_config is NetworkDriver.get_config + with pytest.raises(NotImplementedError): + self.driver.get_config() def test_cli(self): self._setup_mocked_http() -- 2.54.0