From a97c460cc39f6514ad6f9a28378a26d6a30bb593 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Sat, 17 Oct 2026 09:44:51 +0200 Subject: [PATCH] feat: name no warnings and report no package proxy (0.5.0) napalm-linux 0.9.0 names no warnings (netOrk #1111), so the override that kept the inherited get_device_warnings from asking for updates goes. The package proxy it now reports is switched off with the template that sets it: QTS has no apt. Requires napalm-linux 0.9.0. --- napalm_qnap_qts/qnap_qts.py | 10 ++++------ pyproject.toml | 4 ++-- tests/test_qnap_qts.py | 13 +++++++------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/napalm_qnap_qts/qnap_qts.py b/napalm_qnap_qts/qnap_qts.py index f003056..2036efd 100644 --- a/napalm_qnap_qts/qnap_qts.py +++ b/napalm_qnap_qts/qnap_qts.py @@ -78,16 +78,14 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver): get_available_updates = None # type: ignore[assignment] refresh_available_updates = None # type: ignore[assignment] apply_updates = None # type: ignore[assignment] - #: The fix templates LinuxDriver carries need a package manager or net-snmp - #: from packages; QTS has neither, and its SNMP agent is set in its own UI. + #: The fix templates LinuxDriver carries, and the package proxy it reports, + #: need a package manager or net-snmp from packages; QTS has neither, and + #: its SNMP agent is set in its own UI. configure_snmp_agent = None # type: ignore[assignment] configure_package_proxy = None # type: ignore[assignment] + get_package_proxy = None # type: ignore[assignment] ensure_package = None # type: ignore[assignment] - def get_device_warnings(self) -> list: - """Nothing to report: the inherited one asks for updates QTS cannot list.""" - return [] - SNMP_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID SNMP_FINGERPRINT = [ FingerprintRule("qnap", weight=9.0), diff --git a/pyproject.toml b/pyproject.toml index a783f86..bfd36f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "napalm-qnap-qts" -version = "0.4.0" +version = "0.5.0" description = "NAPALM driver for QNAP NAS systems running QTS via SSH" readme = "README.md" requires-python = ">=3.9" @@ -44,7 +44,7 @@ classifiers = [ dependencies = [ "napalm>=4.0", "napalm-device-types>=2.6.0", - "napalm-linux>=0.8.0", + "napalm-linux>=0.9.0", "netmiko>=4.0.0", "paramiko>=5.0.0", # CVE-2026-44405 ] diff --git a/tests/test_qnap_qts.py b/tests/test_qnap_qts.py index c5f9dfa..b0870f6 100644 --- a/tests/test_qnap_qts.py +++ b/tests/test_qnap_qts.py @@ -232,14 +232,15 @@ class TestFixesQtsCannotTake: capability check -- is it callable? -- answers no.""" @pytest.mark.parametrize( - "name", ["configure_snmp_agent", "configure_package_proxy", "ensure_package"] + "name", + ["configure_snmp_agent", "configure_package_proxy", "get_package_proxy", "ensure_package"], ) def test_switched_off(self, name): assert getattr(QnapQtsDriver, name) is None -def test_device_warnings_do_not_ask_for_updates_qts_cannot_list(): - """The inherited get_device_warnings called get_available_updates, which is - None here, and logged a TypeError on every poll (#6).""" - driver = QnapQtsDriver("nas", "admin", "pw") - assert driver.get_device_warnings() == [] +def test_no_warnings_of_its_own(): + """napalm-linux names no warnings any more (netOrk #1111), so neither does + this driver; the override that kept the inherited one from asking for updates + QTS cannot list (#6) is gone with it.""" + assert not callable(getattr(QnapQtsDriver, "get_device_warnings", None))