Skip to content

Fix LLDP neighbors detail retrieval on ASR9K devices #2207

Open
@Kani999

Description

@Kani999

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:

  1. First attempts the generic query
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions