From fd972a427e1b1969edb004f5b364ffce65fff1c3 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Fri, 21 Aug 2026 12:50:10 +0700 Subject: [PATCH] refactor: drop the seven forwarding methods AccessPointDriver forced AccessPointDriver used to declare get_services, manage_service, get_available_updates, apply_updates, get_packages, install_package and remove_package as NotImplementedError stubs. Those stubs preceded OpenWrtSystemMixin and OpenWrtPackageMixin in the MRO and shadowed their working implementations, so this driver carried a forwarder for each one purely to delegate past the base. napalm-device-types v1.0 makes role bases declaration-only, so nothing shadows anything and all seven forwarders are dead weight. Every method now resolves straight to the mixin that implements it. remove_package went with them: the base now calls the method by the name the package mixin already used, uninstall_package, so the name adapter is gone too. --- napalm_openwrt/openwrt.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/napalm_openwrt/openwrt.py b/napalm_openwrt/openwrt.py index 956bbd3..fe92076 100644 --- a/napalm_openwrt/openwrt.py +++ b/napalm_openwrt/openwrt.py @@ -278,26 +278,12 @@ class OpenWrtDriver( # defines NotImplementedError stubs for these) # ------------------------------------------------------------------ - def get_services(self) -> list[dict[str, Any]]: - return OpenWrtSystemMixin.get_services(self) - def manage_service(self, name: str, action: str) -> dict[str, Any]: - return OpenWrtSystemMixin.manage_service(self, name, action) - def get_available_updates(self) -> list[dict[str, Any]]: - return OpenWrtSystemMixin.get_available_updates(self) - def apply_updates(self, packages: list[str]) -> dict[str, Any]: - return OpenWrtSystemMixin.apply_updates(self, packages) - def get_packages(self) -> list[dict[str, Any]]: - return OpenWrtPackageMixin.get_packages(self) - def install_package(self, name: str) -> dict[str, Any]: - return OpenWrtPackageMixin.install_package(self, name) - def remove_package(self, name: str) -> dict[str, Any]: - return OpenWrtPackageMixin.uninstall_package(self, name) # ------------------------------------------------------------------ # UCI parsing helpers