fix(cisco_nxos): record LLDP detail blocks that carry no Port id line - #2355
Open
jacqueswindt-gif wants to merge 1 commit into
Open
Conversation
`show lldp neighbors detail` parsed to zero rows on NX-OS releases that do not emit a `Port id:` line. Not a partial result -- the whole command came back empty, and nothing raised. `NEIGHBOR_INTERFACE` is Required and comes from a rule anchored at the start of the line, so `Local Port id:` correctly does not match it. On a release emitting `Local Port id:` and `Port Description:` and no bare `Port id:`, the value is never filled, and being Required it discards every block. Measured on two Nexus 3064s in one estate: 6.0(2)U2(9Z) returns 250 lines describing 18 neighbours and parses to 0 rows, while 7.0(3)I4(9) returns 208 lines and parses to 14. All 18 blocks on the 6.x switch carry `Local Port id:` and `Port Description:` and none carries `Port id:`. An empty parse from a switch with 18 neighbours is indistinguishable from a switch that has none, so a consumer reports no LLDP adjacency and is believed. Dropping Required lets a block record with the fields the device did send. `NEIGHBOR_NAME` and `LOCAL_INTERFACE` stay Required and still guard against recording junk. Both existing fixtures parse byte-identically before and after, so releases that already worked are unaffected.
jacqueswindt-gif
requested review from
itdependsnetworks,
jmcgill298,
jvanderaa,
matt852 and
mjbear
as code owners
August 27, 2026 11:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On NX-OS releases that do not emit a
Port id:line,show lldp neighbors detailparses to zero rows. Not a partial result — the whole command comes back empty, and nothing raises.NEIGHBOR_INTERFACEisRequiredand is sourced from:That rule is anchored at the start of the line, so
Local Port id:correctly does not match it (it is caught by the rule below). On a release that emitsLocal Port id:andPort Description:but no barePort id:line,NEIGHBOR_INTERFACEis therefore never filled — and because it isRequired, every block is discarded.Where this was seen
Two Cisco Nexus 3064s, same estate:
show lldp neighbors detailOn the 6.x switch all 18 blocks carry
Local Port id:andPort Description:, and none carriesPort id:.The silence is the awkward part: an empty parse from a switch with 18 LLDP neighbours is indistinguishable from a switch that genuinely has none, so a consumer reports "no LLDP adjacency" and is believed.
Fix
Drop
RequiredfromNEIGHBOR_INTERFACE. A block then records with the fields the device did send, instead of the command yielding nothing.NEIGHBOR_NAMEandLOCAL_INTERFACEstayRequired, so they still guard against recording junk.Verification
cisco_nxos_show_lldp_neighbors_detail_no_port_id.{raw,yml}— the block shape that release emits. It parses to 0 rows before this change and 2 rows after.show_lldp_neighbors_detailfixtures parse byte-identically before and after; releases that already worked are unaffected.1896 passedfor the parsed-reference tests and2929 passedfor index/testcase/capture-group.Not included, deliberately
Port Description:is present in this output and currently discarded, and on this release it happens to hold the remote interface name. Mapping it toNEIGHBOR_INTERFACEwould be wrong in general — in the existing..._detail2.rawfixture,Port id: Ethernet1/52sits besidePort Description: SW-NEXUS-UPLINK, where the description is a description. Adding a separatePORT_DESCRIPTIONvalue would be a reasonable follow-up but changes the parsed schema for every consumer, so it is left out of a bug fix.🤖 Generated with Claude Code