feat: read pending updates from the cached firmware status, and run the check on request #8

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

For netOrk MVP 5.

Live check (OPNsense 26.7.5, gw): the cached status has last_check, status: none, needs_reboot: 0 and connection/repository: ok. The reader returned [] in 0.1 s; before, it took up to 15 s and triggered a check. The host status reported no reboot.

$ PYTHONPATH=.:../napalm-device-types pytest -q tests
299 passed

ruff and mypy report nothing new against master.

For netOrk MVP 5. **Live check (OPNsense 26.7.5, gw):** the cached status has `last_check`, `status: none`, `needs_reboot: 0` and `connection/repository: ok`. The reader returned `[]` in 0.1 s; before, it took up to 15 s and triggered a check. The host status reported no reboot. ``` $ PYTHONPATH=.:../napalm-device-types pytest -q tests 299 passed ``` ruff and mypy report nothing new against `master`.
christianmanivong added 1 commit 2026-10-05 22:20:11 +00:00
feat: read pending updates from the cached firmware status, and run the check on request
CI / test (3.10) (push) Successful in 30s
CI / test (3.11) (push) Successful in 29s
CI / test (3.12) (push) Successful in 30s
CI / test (3.10) (pull_request) Successful in 28s
CI / test (3.11) (pull_request) Successful in 27s
CI / test (3.12) (pull_request) Successful in 29s
fdda745388
get_available_updates triggered firmware/check and slept up to 15 s, too
long for a poll, and returned [] when the check had not finished. For netOrk
MVP 5 it now reads the cached GET /api/core/firmware/status:

- [] only when the last check found nothing; it raises when the firewall
  never checked (no last_check) or its connection/repository is not "ok".
- refresh_available_updates(): POST firmware/check, then waits up to 60 s
  for last_check to change.
- get_host_status(): reboot_required from the status' needs_reboot.
christianmanivong merged commit b3e89f003c into master 2026-10-05 22:20:12 +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-opnsense#8