fix: never report "nothing pending" when the package index is gone, and load it on request #4

Merged
christianmanivong merged 1 commits from feat/update-reader-raises into master 2026-10-05 22:20:10 +00:00
Owner

For netOrk MVP 5.

Live check (OpenWrt 25.12.5, ap-2og, rebooted about 21 h earlier):

  • apk version printed only the "opening from cache … No such file" warnings and exited 0, which the old reader turned into "nothing pending".
  • With this change it raises.
  • refresh_available_updates() loaded the index ("OK: 11134 distinct packages available", 6 s), and after that the reader listed 45 pending updates.
$ PYTHONPATH=.:../napalm-device-types pytest -q tests
167 passed

ruff reports nothing new against master.

For netOrk MVP 5. **Live check (OpenWrt 25.12.5, ap-2og, rebooted about 21 h earlier):** - `apk version` printed only the "opening from cache … No such file" warnings and exited 0, which the old reader turned into "nothing pending". - With this change it raises. - `refresh_available_updates()` loaded the index ("OK: 11134 distinct packages available", 6 s), and after that the reader listed **45** pending updates. ``` $ PYTHONPATH=.:../napalm-device-types pytest -q tests 167 passed ``` ruff reports nothing new against `master`.
christianmanivong added 1 commit 2026-10-05 22:20:10 +00:00
OpenWrt keeps its package index in RAM. After a reboot `apk version` only
warns that it cannot open its cached index and exits 0, and `opkg
list-upgradable` prints nothing: both read as "no updates". netOrk keeps
"pending since" per package (MVP 5), so the reader now raises instead:

- apk: on apk's own warning ("opening from cache ... No such file"), or a
  failed exit status.
- opkg: when /var/opkg-lists is empty.
- refresh_available_updates(): apk update / opkg update, success from the
  exit status.
christianmanivong merged commit 75f46913b4 into master 2026-10-05 22:20:10 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-openwrt#4