refactor!: drop the _docker_bin override #5

Merged
christianmanivong merged 1 commits from chore/drop-legacy-docker into main 2026-10-08 06:48:37 +00:00
5 changed files with 23 additions and 15 deletions
+10
View File
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.3.0] – 2026-10-08
### Removed
- The `_docker_bin()` override: napalm-linux 0.3.0 drops the Docker CLI
methods it served. `_container_engine_binary("docker")` returns Container
Station's path itself.
### Changed
- Requires napalm-linux >= 0.3.0.
## [0.2.0] – 2026-10-07
### Added
+5 -4
View File
@@ -32,7 +32,7 @@ output is how a driver ends up passing its own tests and failing on a real NAS.
| `start_vm`, `stop_vm`, `reboot_vm` | `virsh` | pending harvest |
| `set_service_enabled` | `setcfg`, `/etc/init.d` | pending harvest |
| `get_device_warnings` | derived from the above | pending harvest |
| `get_docker_info` | inherited, via `_docker_bin()` | ✅ |
| `container_engines`, `open_container_engine` | Container Station's docker, `system dial-stdio` | ✅ |
| `get_services`, `get_users`, `get_processes` | inherited from `LinuxDriver` | ✅ |
| `get_health_metrics` | inherited (UCD-MIB over SNMP) | ✅ |
| `ping`, `ping_sweep` | inherited from `LinuxDriver` | ✅ |
@@ -94,9 +94,10 @@ QNAP running Virtualization Station is a NAS *and* a hypervisor, and
### Docker
Container Station does not put `docker` on `PATH`; it lives under
`/share/<pool>/.qpkg/container-station/`. The Docker *logic* stays in
`LinuxDriver` and only the path is overridden here, via the `_docker_bin()`
hook.
`/share/<pool>/.qpkg/container-station/`. This driver only says where:
`_container_engine_binary("docker")` returns the path it found, and
`open_container_engine("docker")` from napalm-device-types reaches the Engine
API through it. What runs on the engine is netOrk's (NetOrk/netork#765).
## Harvesting fixtures
+1 -5
View File
@@ -150,14 +150,10 @@ class QnapQtsDriver(StorageDriver, HypervisorDriver, LinuxDriver):
return None
return found.splitlines()[0].strip() or None if found else None
def _docker_bin(self) -> str:
"""Override LinuxDriver's hook: docker is not on PATH under QTS."""
return getattr(self, "_docker_path", None) or "docker"
def _container_engine_binary(self, engine: str) -> str:
"""Container Station keeps docker off PATH; callers never see the path."""
if engine == "docker":
return self._docker_bin()
return getattr(self, "_docker_path", None) or "docker"
return super()._container_engine_binary(engine)
# ── QPKG, not apt ─────────────────────────────────────────────────────────
+2 -2
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "napalm-qnap-qts"
version = "0.2.0"
version = "0.3.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.2.0",
"napalm-linux>=0.3.0",
"netmiko>=4.0.0",
"paramiko>=5.0.0", # CVE-2026-44405
]
+5 -4
View File
@@ -97,7 +97,7 @@ class TestRolesDoNotShadowLinux:
collision. There is nothing left to collide with.
"""
@pytest.mark.parametrize("method", ["get_services", "get_users", "get_docker_info"])
@pytest.mark.parametrize("method", ["get_services", "get_users"])
def test_os_surface_resolves_to_linux(self, method):
"""QTS really is Linux for these, so inheriting them is correct."""
from napalm_linux.linux import LinuxDriver
@@ -179,9 +179,10 @@ class TestDockerBinDiscovery:
with patch.object(driver, "_send", return_value=""):
assert driver._discover_docker_path() == "docker"
def test_docker_bin_hook_returns_the_discovered_path(self, driver):
driver._docker_path = "/opt/docker"
assert driver._docker_bin() == "/opt/docker"
def test_the_old_docker_methods_are_gone(self):
"""netOrk reaches Container Station over the Engine API (NetOrk/netork#765)."""
for name in ("get_docker_info", "get_docker_outdated", "_docker_bin"):
assert not hasattr(QnapQtsDriver, name), name
class TestContainerEngineBinary: