From 5e371db3aff8654d7c39602865fe6305ae38415e Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Tue, 6 Oct 2026 00:20:12 +0200 Subject: [PATCH] fix: do not claim update reading or applying QTS cannot do QTS has no apt, dnf or opkg, so the update readers inherited from LinuxDriver find no package manager, and QPKG updates are not implemented. get_available_updates, refresh_available_updates and apply_updates are None, the same opt-out as manage_service: netOrk's patch groups and compliance report include a driver only when these are callable. --- napalm_qnap_qts/qnap_qts.py | 5 +++++ tests/test_qnap_qts.py | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/napalm_qnap_qts/qnap_qts.py b/napalm_qnap_qts/qnap_qts.py index 3e0dd7d..d3ac268 100644 --- a/napalm_qnap_qts/qnap_qts.py +++ b/napalm_qnap_qts/qnap_qts.py @@ -73,6 +73,11 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver): #: makes every "can it control services?" check -- is ``manage_service`` #: callable -- answer no, rather than offering buttons that cannot work. manage_service = None # type: ignore[assignment] + #: The same for updates: QTS has no apt, dnf or opkg, and QPKG updates are + #: not implemented. netOrk leaves a driver without them out of patching. + get_available_updates = None # type: ignore[assignment] + refresh_available_updates = None # type: ignore[assignment] + apply_updates = None # type: ignore[assignment] SNMP_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID SNMP_FINGERPRINT = [ diff --git a/tests/test_qnap_qts.py b/tests/test_qnap_qts.py index fd0e99f..9750edb 100644 --- a/tests/test_qnap_qts.py +++ b/tests/test_qnap_qts.py @@ -192,3 +192,13 @@ def test_services_cannot_be_controlled(): assert callable(getattr(LinuxDriver, "manage_service", None)) assert not callable(getattr(QnapQtsDriver, "manage_service", None)) + + + +def test_updates_are_not_read_or_applied_here(): + """QTS has no apt, dnf or opkg: the readers inherited from LinuxDriver find no + package manager, and QPKG updates are not implemented. Saying so keeps QNAP out + of netOrk's patch groups and compliance report, which ask whether these + methods are callable.""" + for method in ("get_available_updates", "refresh_available_updates", "apply_updates"): + assert not callable(getattr(QnapQtsDriver, method, None)), method