Open
Description
Problem Description
When attempting to retrieve LLDP neighbor details on Cisco ASR9K devices using the get_lldp_neighbors_detail()
method, the operation fails with an XMLCLIError. This occurs because ASR9K devices require a more specific XML path in the RPC call.
Current Behavior
The current implementation uses a generic LLDP query:
<Get><Operational>
<LLDP><NodeTable></NodeTable></LLDP>
</Operational></Get>
This works on most IOS-XR devices but fails on ASR9K models with an XMLCLIError.
Proposed Solution
I've implemented a try/except pattern that:
- First attempts the generic query
- If that fails, falls back to a more specific query that includes the exact node path:
<Get><Operational>
<LLDP><NodeTable><Node><Naming><NodeName>
<Rack>0</Rack><Slot>0</Slot><Instance>CPU0</Instance>
</NodeName></Naming></Node></NodeTable></LLDP>
</Operational></Get>
This approach maintains compatibility with all IOS-XR devices while adding support for ASR9K models.
Metadata
Metadata
Assignees
Labels
No labels