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.
This commit is contained in:
Christian Manivong
2026-08-21 12:50:10 +07:00
parent 597a59fa39
commit fd972a427e
-14
View File
@@ -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