Commit Graph
4 Commits
Author SHA1 Message Date
Christian Manivong ec88cfd734 feat(updates): raise PackageIndexMissing when the index is not in RAM
driver / lint (pull_request) Successful in 13s
driver / standard (pull_request) Successful in 16s
driver / types (pull_request) Successful in 46s
driver / test (3.13) (pull_request) Successful in 44s
driver / test (3.12) (pull_request) Successful in 51s
driver / lowest (pull_request) Successful in 25s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 55s
CI / driver (pull_request) Successful in 1m55s
driver / publish (pull_request) Skipped
After a reboot apk and opkg have no package index. get_available_updates()
raised a bare RuntimeError for that, which netOrk could not tell from a
read that failed. It now raises napalm-device-types' PackageIndexMissing,
so netOrk loads the index instead of reporting a communication error.

Needs napalm-device-types 4.39.0.

Refs NetOrk/netork#2527
2026-11-14 23:46:09 +01:00
Christian Manivong e4ae42fea0 test: documentation names and addresses in fixtures
driver / types (pull_request) Successful in 1m0s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 15s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 44s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Successful in 2m56s
driver / publish (pull_request) Skipped
Fixtures, docstring examples and the README use neutral host names
(ap-01, ap-02) and addresses from the documentation ranges 192.0.2.0/24,
198.51.100.0/24 and 203.0.113.0/24, mapped one to one so every test
keeps its meaning: the management network test still has its address
inside that network, a route still covers its prefix. Loopback, the
wildcard address and netmasks are unchanged.
2026-11-12 19:21:54 +01:00
Christian Manivong c211ba0d9e fix(updates): only the exit status decides apply_updates
apply_updates ran apk/opkg upgrade and returned success whatever
happened, so a failed upgrade was reported as done. The command now
prints its exit status after the marker get_available_updates already
uses; a non-zero or missing status is a failure, named in "error".

Closes #11
2026-11-01 21:44:26 +01:00
Christian Manivong 388118cd1b fix: never report "nothing pending" when the package index is gone, and load it on request
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.
2026-10-06 00:20:09 +02:00