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

+10 -1
View File
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- The floor on napalm-device-types is 4.23.0, the first release with what this driver uses.
- The floor on napalm-device-types is 4.24.0, the first release with what this driver
uses (its shared `lldpctl` parser).
- Python 3.12 is the floor (`requires-python = ">=3.12"`): netOrk runs every driver
on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6).
@@ -63,6 +64,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
napalm-device-types (NetOrk/netork#1636).
### Fixed
- `get_lldp_neighbors()` and `get_lldp_neighbors_detail()` raise when lldpctl fails
(lldpd not running, lldpctl missing) or the node gives no answer, with lldpctl's
message; they used to return no neighbours, the same answer as a node without any
(#44). Capabilities carry NAPALM's names (`telephone`, `wlan-access-point`,
`docsis-cable-device`) instead of lldpd's symbols (`tel`, `wlan`, `docsis`).
lldpd is read with `lldpctl -f keyvalue` through napalm-device-types' shared
parser, so a neighbour named by its chassis MAC also carries it as `mac`, and an
interface name with a dot stays whole.
- `get_ipv6_neighbors_table()` reports an unknown age as `-1.0`, as `get_arp_table()`
already did (napalm-device-types' `ARP_AGE_UNKNOWN`), instead of `0.0`, which
means "confirmed just now" (NetOrk/netork#1327).