fix(getters): raise on a failed LLDP or environment read
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 21s
driver / types (pull_request) Failing after 6s
driver / test (3.12) (pull_request) Failing after 17s
driver / test (3.13) (pull_request) Failing after 15s
driver / lowest (pull_request) Failing after 6s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Failing after 38s
CI / driver (pull_request) Failing after 1m36s
driver / publish (pull_request) Skipped

lldpctl's error text has no "=", so a missing lldpctl or a stopped
lldpd read as a device without neighbours. lldpctl now runs as
napalm-device-types' LLDPCTL_KEYVALUE_COMMAND, which brings its exit
status and message back, and the shared parser raises on a failure.

get_environment swallowed an unreadable /proc/stat or /proc/meminfo
and reported 0 % CPU and 0 bytes of memory, a plausible value instead
of a failure. Both now raise ValueError; 0 % stays for counters that
did not move between the two reads.

Closes #27
This commit is contained in:
Christian Manivong committed 2026-11-02 08:47:15 +01:00
1 parent 231def768e
commit aafb5636a9
5 files changed
+111 -32

No files matched your search

+3 -3
View File
@@ -61,9 +61,9 @@ device.close()
| `get_arp_table` | ✅ | Uses `ip neigh show` |
| `get_mac_address_table` | ✅ | Uses `bridge fdb show` |
| `get_config` | ✅ | Uses `uci export` |
| `get_environment` | ✅ | CPU from `/proc/stat`, memory from `/proc/meminfo` |
| `get_lldp_neighbors` | ✅ | Requires `lldpd` installed and running; reads only, never starts or configures it |
| `get_lldp_neighbors_detail` | ✅ | Requires `lldpd` installed and running; reads only, never starts or configures it |
| `get_environment` | ✅ | CPU from `/proc/stat`, memory from `/proc/meminfo`; raises when either cannot be read |
| `get_lldp_neighbors` | ✅ | Requires `lldpd` installed and running (raises otherwise); reads only, never starts or configures it |
| `get_lldp_neighbors_detail` | ✅ | Requires `lldpd` installed and running (raises otherwise); reads only, never starts or configures it |
| `get_listening_sockets` | ✅ | busybox `netstat -lntup`, procd service from the process's cgroup (napalm-device-types `ListeningSocketsMixin`); over an SSH exec channel |
## Configuration management