fix(config): leave get_config to NAPALM's stub
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 17s
driver / types (pull_request) Successful in 57s
driver / test (3.13) (pull_request) Successful in 54s
driver / test (3.12) (pull_request) Successful in 1m0s
driver / lowest (pull_request) Successful in 25s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 1m10s
CI / driver (pull_request) Successful in 2m24s
driver / publish (pull_request) Skipped

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.
This commit is contained in:
Christian Manivong committed 2026-11-12 15:28:25 +01:00
1 parent ca8d02233a
commit fe7c3fc7f9
2 files changed
+9 -13

No files matched your search

-10
View File
@@ -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 {}
+9 -3
View File
@@ -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()