Skip to content

[IOS-XR] show vrf all detail parser - Interfaces list not captured #910

Open
@Kani999

Description

@Kani999

Description

While using the Genieparser for the show vrf all detail command on an IOS XR device, we've encountered an issue where the parser fails to capture the list of interfaces assigned to a VRF. As a result, the interfaces field in the parsed JSON output is empty, even though interfaces are present in the actual command output.

Example

  • Raw data: As shown above, the Interfaces section includes FortyGigE0/0/0/2/0.444444
VRF VRF_NAME; RD 10.10.10.10:10; VPN ID not set
VRF mode: Regular
Description not set
Interfaces:
  FortyGigE0/0/0/2/0.444444
Address family IPV4 Unicast
  Import VPN route-target communities:
    RT:2222:3333
  Export VPN route-target communities:
    RT:2222:3333
  No import route policy
  No export route policy
Address family IPV6 Unicast
  No import VPN route-target communities
  No export VPN route-target communities
  No import route policy
  No export route policy
  • Parsed data: interfaces = []
{
    "VRF_NAME": {
        "address_family": {
            "ipv4 unicast": {
                "route_target": {
                    "2222:3333": {
                        "route_target": "2222:3333",
                        "rt_type": "both"
                    }
                }
            },
            "ipv6 unicast": {}
        },
        "description": "not set",
        "interfaces": [],
        "route_distinguisher": "10.10.10.10:10",
        "vrf_mode": "regular"
    }
}

Expected Behavior:

The parser should correctly parse and include the list of interfaces assigned to the VRF in the output. In this case, the interfaces field should contain at least one interface, FortyGigE0/0/0/2/0.444444.

Reproduce problem:

from genie.libs.parser.iosxr.show_vrf import ShowVrfAllDetail
from pprint import pprint


input_data = """
VRF VRF_NAME; RD 10.10.10.10:10; VPN ID not set
VRF mode: Regular
Description not set
Interfaces:
  FortyGigE0/0/0/2/0.444444
Address family IPV4 Unicast
  Import VPN route-target communities:
    RT:2222:3333
  Export VPN route-target communities:
    RT:2222:3333
  No import route policy
  No export route policy
Address family IPV6 Unicast
  No import VPN route-target communities
  No export VPN route-target communities
  No import route policy
  No export route policy
"""

result = ShowVrfAllDetail.cli(self = None, output=input_data)
pprint(result)

Metadata

Metadata

Assignees

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