fix(lldp): read lldpd through the shared parser and raise on failure
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Failing after 29s
driver / test (3.12) (pull_request) Failing after 20s
driver / test (3.13) (pull_request) Failing after 17s
driver / lowest (pull_request) Failing after 18s
driver / security (pull_request) Failing after 45s
driver / build (pull_request) Successful in 35s
CI / driver (pull_request) Failing after 1m43s
driver / publish (pull_request) Skipped

lldpcli's text was read with 2>/dev/null || true, so lldpd not running,
lldpctl missing or the command not running at all came back as a node
without neighbours. Capabilities were lldpd's symbols lower-cased (tel,
wlan, docsis) rather than NAPALM's names.

The node now runs napalm-device-types' LLDPCTL_KEYVALUE_COMMAND, whose
output carries lldpctl's exit status; parse_lldpctl_keyvalue raises on a
failure, an empty answer raises too, and the lldp_neighbors projections
give NAPALM's capability names and the chassis MAC. The module is under
strict mypy now; the floor on napalm-device-types rises to 4.24.0.

Closes #44
This commit is contained in:
Christian Manivong committed 2026-11-02 08:55:59 +01:00
1 parent 6a8132e234
commit f93daa381e
7 files changed
+184 -136

No files matched your search

+2 -2
View File
@@ -116,8 +116,8 @@ device = driver(
| `compare_config` | Unified diff |
| `commit_config` | Writes `/etc/network/interfaces` + `ifreload -a` |
| `discard_config` / `rollback` | Revert candidate |
| `get_lldp_neighbors` | `lldpcli show neighbors` via exec |
| `get_lldp_neighbors_detail` | Full LLDP detail |
| `get_lldp_neighbors` | `lldpctl -f keyvalue` via exec (napalm-device-types' parser); raises when lldpctl fails |
| `get_lldp_neighbors_detail` | Full LLDP detail, capabilities in NAPALM's names |
| `get_ipv6_neighbors_table` | `ip -6 neigh show` |
| `ping` | Linux `ping` via exec endpoint |
| `traceroute` | `traceroute -n` via exec endpoint |