refactor!: keep one name for pending updates, drop the alias
This driver implemented get_pending_updates and then carried get_available_updates as a one-line alias, because netOrk's API only ever called the latter. Two names for one thing, with the driver bridging the gap. napalm-device-types v1.0 collapses them onto get_available_updates — the name four drivers and every netOrk call site already used — so the alias has nothing left to bridge. BREAKING CHANGE: get_pending_updates is gone; call get_available_updates. The seven pre-existing test failures in this repo are untouched and unrelated; see netork#110.
This commit is contained in:
@@ -1019,7 +1019,7 @@ class LinuxDriver(OSDriver):
|
||||
success = not any(kw in low for kw in ("error:", "failed", "not found", "is not installed", "no packages"))
|
||||
return {"success": success, "output": raw.strip()}
|
||||
|
||||
def get_pending_updates(self) -> list[UpdateDict]:
|
||||
def get_available_updates(self) -> list[UpdateDict]:
|
||||
if self._pkg_manager == "apt":
|
||||
return self._get_updates_apt()
|
||||
if self._pkg_manager in ("dnf", "yum"):
|
||||
@@ -1032,10 +1032,6 @@ class LinuxDriver(OSDriver):
|
||||
f"Package manager '{self._pkg_manager}' is not supported"
|
||||
)
|
||||
|
||||
def get_available_updates(self) -> list[UpdateDict]:
|
||||
"""Alias for get_pending_updates(); called by the netork API backend."""
|
||||
return self.get_pending_updates()
|
||||
|
||||
def get_device_warnings(self) -> List[dict[str, Any]]:
|
||||
"""Return warning dicts for issues detected on this device.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user