feat(lldp): parse lldpctl keyvalue into one row per neighbour
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Failing after 16s
driver / types (pull_request) Successful in 1m8s
driver / test (3.12) (pull_request) Successful in 1m18s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 50s
driver / build (pull_request) Successful in 37s
driver / security (pull_request) Successful in 1m18s
CI / driver (pull_request) Failing after 3m7s
driver / publish (pull_request) Skipped

napalm-linux, napalm-openwrt and napalm-proxmox each parsed lldpd's
neighbours on their own, and the copies grouped lines by interface (two
neighbours on one port merged), cut the interface name at its first dot
and looked for chassis.id.value, a key lldpd never prints. The parse
lives here once now: neighbours are split at their via line, the
interface name runs up to the neighbour's first field, ids are read
under the type lldpd prints them with, and a failed lldpctl raises.

The rows project into NAPALM's two LLDP shapes with lldp_neighbors and
lldp_neighbors_detail, the projection part of #10.

Refs #10
This commit is contained in:
christianmanivong committed 2026-11-02 08:42:10 +01:00
1 parent ad9ec0fb4d
commit 4427be35cc
7 files changed
+733

No files matched your search

+12
View File
@@ -7,6 +7,18 @@ recorded here; their history is the git log.
## [Unreleased]
### Added
- `parse_lldpctl_keyvalue(output)` and `LLDPCTL_KEYVALUE_COMMAND`: lldpd's neighbours
(`lldpctl -f keyvalue`) as one `LldpNeighborRow` per neighbour, for every driver of a
host that runs lldpd. Several neighbours on one port (a phone and the PC behind it, an
unmanaged switch) stay apart, an interface name with dots (`eth0.1`) stays whole, the
chassis and port ids are read whatever their type (MAC, address, interface name, local
id), with management addresses and capabilities. A failed lldpctl (lldpd not running,
lldpctl missing) raises instead of reading as no neighbours.
- `lldp_neighbors(rows)` and `lldp_neighbors_detail(rows, interface="")`: NAPALM's
`get_lldp_neighbors` and `get_lldp_neighbors_detail` from those rows, so a driver no
longer builds the two shapes itself.
### Fixed
- `DNF_SECURITY_COMMAND` reads the cached metadata only (`dnf --cacheonly`), as
`APT_UPGRADABLE_COMMAND` reads apt's local index (#76). With an expired cache dnf