feat: name no warnings and report no package proxy (0.5.0) #9

Merged
christianmanivong merged 1 commits from feat/facts-not-warnings into main 2026-10-17 09:02:44 +00:00
3 changed files with 13 additions and 14 deletions
Showing only changes of commit 472518576e - Show all commits

No files matched your search

+4 -6
View File
@@ -78,16 +78,14 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver):
get_available_updates = None # type: ignore[assignment] get_available_updates = None # type: ignore[assignment]
refresh_available_updates = None # type: ignore[assignment] refresh_available_updates = None # type: ignore[assignment]
apply_updates = None # type: ignore[assignment] apply_updates = None # type: ignore[assignment]
#: The fix templates LinuxDriver carries need a package manager or net-snmp #: The fix templates LinuxDriver carries, and the package proxy it reports,
#: from packages; QTS has neither, and its SNMP agent is set in its own UI. #: 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_snmp_agent = None # type: ignore[assignment]
configure_package_proxy = None # type: ignore[assignment] configure_package_proxy = None # type: ignore[assignment]
get_package_proxy = None # type: ignore[assignment]
ensure_package = 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_OBJECT_ID_PREFIX = QNAP_ENTERPRISE_OID
SNMP_FINGERPRINT = [ SNMP_FINGERPRINT = [
FingerprintRule("qnap", weight=9.0), FingerprintRule("qnap", weight=9.0),
+2 -2
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "napalm-qnap-qts" name = "napalm-qnap-qts"
version = "0.4.0" version = "0.5.0"
description = "NAPALM driver for QNAP NAS systems running QTS via SSH" description = "NAPALM driver for QNAP NAS systems running QTS via SSH"
readme = "README.md" readme = "README.md"
requires-python = ">=3.9" requires-python = ">=3.9"
@@ -44,7 +44,7 @@ classifiers = [
dependencies = [ dependencies = [
"napalm>=4.0", "napalm>=4.0",
"napalm-device-types>=2.6.0", "napalm-device-types>=2.6.0",
"napalm-linux>=0.8.0", "napalm-linux>=0.9.0",
"netmiko>=4.0.0", "netmiko>=4.0.0",
"paramiko>=5.0.0", # CVE-2026-44405 "paramiko>=5.0.0", # CVE-2026-44405
] ]
+7 -6
View File
@@ -232,14 +232,15 @@ class TestFixesQtsCannotTake:
capability check -- is it callable? -- answers no.""" capability check -- is it callable? -- answers no."""
@pytest.mark.parametrize( @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): def test_switched_off(self, name):
assert getattr(QnapQtsDriver, name) is None assert getattr(QnapQtsDriver, name) is None
def test_device_warnings_do_not_ask_for_updates_qts_cannot_list(): def test_no_warnings_of_its_own():
"""The inherited get_device_warnings called get_available_updates, which is """napalm-linux names no warnings any more (netOrk #1111), so neither does
None here, and logged a TypeError on every poll (#6).""" this driver; the override that kept the inherited one from asking for updates
driver = QnapQtsDriver("nas", "admin", "pw") QTS cannot list (#6) is gone with it."""
assert driver.get_device_warnings() == [] assert not callable(getattr(QnapQtsDriver, "get_device_warnings", None))