feat(updates): the update history from apt's own log, with Proxmox VE 9.3's ids (NetOrk/netork#2728)
AptHistoryMixin implements get_update_history over run_command: history.log and its
rotations in one round trip as the login user, root only for a file that user may not
read. Dates are read in the host's zone; a transaction's id is its start and the number
of earlier ones with that start in the same file, as GET /nodes/{node}/apt/history names
it. Malformed blocks are left out, a report cut short raises.
This commit is contained in:
1 parent
5985c87cc8
commit
e3420269b7
6 files changed
+843
No files matched your search
@@ -185,6 +185,13 @@ another release than the host's is the caller's to judge (`suite_release` gives
|
||||
source file to *codename*, after fetching each new suite's `InRelease` with apt's downloader:
|
||||
where the vendor has none, the file stays as it is.
|
||||
|
||||
`AptHistoryMixin` (`napalm_device_types.apt_history`) implements
|
||||
`UpdateMixin.get_update_history` from apt's own log over the driver's `run_command`: every
|
||||
transaction in `/var/log/apt/history.log` and its rotations, newest first, with the same
|
||||
ids Proxmox VE 9.3's `GET /nodes/{node}/apt/history` gives (start time and the index among
|
||||
those that started in the same second of the same file). A driver whose host may run
|
||||
another package manager gates it, as napalm-linux does.
|
||||
|
||||
`HostStatusMixin` (`get_host_status`) is mixed in the same way: whether a Linux host needs
|
||||
a reboot to finish an update (`/var/run/reboot-required`, `needs-restarting -r`, or a newer
|
||||
kernel of the running flavour installed), whether it patches itself (unattended-upgrades,
|
||||
|
||||
Reference in new issue
Block a user