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
Owner

Six bug fixes, one commit each.

  • fix(driver): __init__ works on a copy of the caller's optional_args (#19).
  • fix(services): manage_service reports the command's exit status, not unconditional success (#3).
  • fix(updates): apply_updates likewise; a non-zero or missing status gives success: False plus error (#11).
  • fix(environment): CPU usage is the difference of two /proc/stat reads a second apart, not the average since boot (#10).
  • fix(lldp): several neighbours on one port stay separate; a neighbour ends where the next one starts (#9). The fixture is built from lldpd's output layout (display.c/kv_writer.c), not recorded from a device.
  • fix(lldp): the LLDP getters only read (lldpctl -f keyvalue); they no longer enable/start lldpd or rewrite its interface list (#8). Behaviour change: a device whose lldpd is stopped shows no neighbours until something starts it. Where lldpd setup moves to (netOrk via ensure_package + manage_service, and a device-types template for the interface list) is still open — do not merge this commit before that is decided.

#12 was already fixed by 968d658 (install_auc removed; installs go through install_package, which branches on apk/opkg).

Tested: fixtures only. pytest 217 passed, ruff, mypy, napalm-standard check/ratchet green.

Closes #19
Closes #3
Closes #11
Closes #10
Closes #9
Closes #8

Six bug fixes, one commit each. - `fix(driver)`: `__init__` works on a copy of the caller's `optional_args` (#19). - `fix(services)`: `manage_service` reports the command's exit status, not unconditional success (#3). - `fix(updates)`: `apply_updates` likewise; a non-zero or missing status gives `success: False` plus `error` (#11). - `fix(environment)`: CPU usage is the difference of two `/proc/stat` reads a second apart, not the average since boot (#10). - `fix(lldp)`: several neighbours on one port stay separate; a neighbour ends where the next one starts (#9). The fixture is built from lldpd's output layout (`display.c`/`kv_writer.c`), not recorded from a device. - `fix(lldp)`: the LLDP getters only read (`lldpctl -f keyvalue`); they no longer enable/start lldpd or rewrite its interface list (#8). **Behaviour change:** a device whose lldpd is stopped shows no neighbours until something starts it. Where lldpd setup moves to (netOrk via `ensure_package` + `manage_service`, and a device-types template for the interface list) is still open — do not merge this commit before that is decided. #12 was already fixed by 968d658 (install_auc removed; installs go through `install_package`, which branches on apk/opkg). Tested: fixtures only. pytest 217 passed, ruff, mypy, `napalm-standard check`/`ratchet` green. Closes #19 Closes #3 Closes #11 Closes #10 Closes #9 Closes #8
christianmanivong added 6 commits 2026-11-01 20:54:37 +00:00
__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
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
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
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
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
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
783a4ee0cb
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
christianmanivong merged commit 004c3e9322 into main 2026-11-01 22:00:02 +00:00
christianmanivong deleted branch fix/bugs-2026-11 2026-11-01 22:00:03 +00:00
Sign in to join this conversation.