fix(updates): read dnf and yum updates from the cached metadata (#59) #60

Merged
christianmanivong merged 2 commits from fix/dnf-cache-only into main 2026-11-02 07:22:57 +00:00
Owner

dnf check-update / yum check-update and yum's security query now run with --cacheonly, as apt's read uses its local index. With an expired cache they downloaded the repositories' metadata first, and on an Oracle Linux 9.8 host on OCI the poll ran into netOrk's 120 s budget on every run, so the device went offline. refresh_available_updates() (dnf makecache) still refreshes the cache. Without a cache the read fails at once and says to refresh the index. The README row that called check-update unprivileged now says it runs as root and reads root's cache.

Tests: dnf and yum both send --cacheonly for check-update and for the security query; a failed read with no output says to refresh the index.

Depends on NAPALM/napalm-device-types#76: its PR has to be on main first, because CI installs device-types from there and the [dnf] case checks the shared security command.

Closes #59

`dnf check-update` / `yum check-update` and yum's security query now run with `--cacheonly`, as apt's read uses its local index. With an expired cache they downloaded the repositories' metadata first, and on an Oracle Linux 9.8 host on OCI the poll ran into netOrk's 120 s budget on every run, so the device went offline. `refresh_available_updates()` (`dnf makecache`) still refreshes the cache. Without a cache the read fails at once and says to refresh the index. The README row that called check-update unprivileged now says it runs as root and reads root's cache. Tests: dnf and yum both send `--cacheonly` for check-update and for the security query; a failed read with no output says to refresh the index. **Depends on NAPALM/napalm-device-types#76**: its PR has to be on `main` first, because CI installs device-types from there and the `[dnf]` case checks the shared security command. Closes #59
christianmanivong added 1 commit 2026-11-02 07:08:06 +00:00
fix(updates): read dnf and yum updates from the cached metadata
driver / standard (pull_request) Failing after 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m0s
driver / test (3.12) (pull_request) Failing after 1m1s
driver / test (3.13) (pull_request) Failing after 53s
driver / lowest (pull_request) Failing after 28s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Failing after 2m30s
driver / publish (pull_request) Skipped
d226ebf764
`dnf check-update` and `yum check-update`, and yum's security query, download
the repositories' metadata first whenever the cached copy has expired. On an
Oracle Linux host on OCI that outlasted netOrk's 120 s poll on every run, and
the device went offline. They now run with --cacheonly, as apt's read uses its
local index; refresh_available_updates (`dnf makecache`) still refreshes it.
Without a cache the read fails at once and says to refresh the index. The
README row claimed check-update ran unprivileged; it runs as root.

dnf's security query is NAPALM/napalm-device-types#76.

Closes #59
christianmanivong added 1 commit 2026-11-02 07:18:42 +00:00
style(updates): keep linux.py within its recorded length
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 52s
driver / lowest (pull_request) Successful in 29s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m27s
driver / publish (pull_request) Skipped
b891acd29c
The quality ratchet records 2142 lines for napalm_linux/linux.py; the docstring of the previous commit took it to 2147.
christianmanivong merged commit 5687f5d9a1 into main 2026-11-02 07:22:57 +00:00
christianmanivong deleted branch fix/dnf-cache-only 2026-11-02 07:22:57 +00:00
Sign in to join this conversation.