install_package and uninstall_package (napalm_openwrt/packages_mixin.py 203-229) run apk add|del / opkg install|remove and decide success by searching the cleaned output (lines 214 and 228):
The exit status is never looked at. Failures whose text contains none of the four words read as success — e.g. opkg's dependency failure (Collected errors: / Cannot satisfy the following dependencies for … / Cannot install package …: "errors:" is not "error:"). The reverse also happens: a successful install whose output mentions a file or package containing "failed" reads as a failure.
Append ; echo __RC=$? (the _RC_MARKER the file already uses) and decide by the status alone; keep the output for the message. Test-first: an opkg output with Cannot install package and status 255 is a failure; a status 0 output containing "failed" in a file name is a success.
Priority: P3 — a failed package install (e.g. ensure_package("lldpd")) is reported as done.
Found during the bug sweep of 2026-11-01.
## What happens
`install_package` and `uninstall_package` (`napalm_openwrt/packages_mixin.py` 203-229) run `apk add|del` / `opkg install|remove` and decide success by searching the cleaned output (lines 214 and 228):
```python
success = not any(kw in low for kw in ("error:", "failed", "not found", "unknown package"))
```
The exit status is never looked at. Failures whose text contains none of the four words read as success — e.g. opkg's dependency failure (`Collected errors:` / `Cannot satisfy the following dependencies for …` / `Cannot install package …`: "errors:" is not "error:"). The reverse also happens: a successful install whose output mentions a file or package containing "failed" reads as a failure.
Same pattern as #3 (`manage_service`) and #11 (`apply_updates`), and as NAPALM/napalm-linux#4.
## Expected
Append `; echo __RC=$?` (the `_RC_MARKER` the file already uses) and decide by the status alone; keep the output for the message. Test-first: an opkg output with `Cannot install package` and status 255 is a failure; a status 0 output containing "failed" in a file name is a success.
Priority: P3 — a failed package install (e.g. `ensure_package("lldpd")`) is reported as done.
Found during the bug sweep of 2026-11-01.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
install_packageanduninstall_package(napalm_openwrt/packages_mixin.py203-229) runapk add|del/opkg install|removeand decide success by searching the cleaned output (lines 214 and 228):The exit status is never looked at. Failures whose text contains none of the four words read as success — e.g. opkg's dependency failure (
Collected errors:/Cannot satisfy the following dependencies for …/Cannot install package …: "errors:" is not "error:"). The reverse also happens: a successful install whose output mentions a file or package containing "failed" reads as a failure.Same pattern as #3 (
manage_service) and #11 (apply_updates), and as NAPALM/napalm-linux#4.Expected
Append
; echo __RC=$?(the_RC_MARKERthe file already uses) and decide by the status alone; keep the output for the message. Test-first: an opkg output withCannot install packageand status 255 is a failure; a status 0 output containing "failed" in a file name is a success.Priority: P3 — a failed package install (e.g.
ensure_package("lldpd")) is reported as done.Found during the bug sweep of 2026-11-01.