fix: six open bugs (#19, #3, #11, #10, #9, #8) #24

Merged
christianmanivong merged 6 commits from fix/bugs-2026-11 into main 2026-11-01 22:00:02 +00:00
6 Commits
Author SHA1 Message Date
Christian Manivong 783a4ee0cb fix(lldp): read neighbours without starting or reconfiguring lldpd
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m0s
driver / test (3.13) (pull_request) Successful in 53s
driver / lowest (pull_request) Successful in 24s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 56s
CI / driver (pull_request) Successful in 2m19s
driver / publish (pull_request) Skipped
get_lldp_neighbors, which a poll calls every time, enabled and started a
stopped lldpd and rewrote lldpd's interface list with uci, restarting
the daemon. A getter must not change the device. Both LLDP getters now
only run lldpctl; installing and starting lldpd are ensure_package and
manage_service.

Closes #8
2026-11-01 21:48:31 +01:00
Christian Manivong 5e71f0b471 fix(lldp): keep every neighbour on a port
The keyvalue output was grouped by local interface only, so with several
neighbours on one port their keys overwrote each other and one mixed
entry came back. A neighbour now ends where the next one opens (alias,
then via, as lldpd prints it); a key repeated inside one neighbour, such
as one mgmt-ip per address, does not start a new one.

Closes #9
2026-11-01 21:47:34 +01:00
Christian Manivong 097d9b9581 fix(environment): CPU usage from two reads a second apart
get_environment promised two samples one second apart but read
/proc/stat once, so the figure was the average since boot: a box at
100 % for the last minute showed its lifetime average. It now reads the
cpu line twice, a second apart, and uses the difference.

Closes #10
2026-11-01 21:45:24 +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 16e0fa9d5e fix(services): only the exit status decides manage_service
manage_service returned success for every action, so a failed start or
a missing init script showed up as done. The command now prints its
exit status after a marker, and only that status decides.

Closes #3
2026-11-01 21:43:56 +01:00
Christian Manivong 45f5b65427 fix(driver): leave the caller's optional_args unchanged
__init__ popped "port" out of the dict it was handed, so the caller's
own optional_args lost its port. The driver now works on a copy.

Closes #19
2026-11-01 21:43:09 +01:00