Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOS-XR] Fix show vrf all detail parser - capture all interface names #911

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Kani999
Copy link
Contributor

@Kani999 Kani999 commented Nov 8, 2024

Description

Enhance interface parsing in 'show vrf all detail' parser

Implemented a general regex pattern to capture all interface names:

  • Replaced the previous regex that relied on specific interface prefixes (e.g., Gi, Bun, Ten, etc.) with a more general pattern r'^(?P<intf>[A-Za-z][-A-Za-z0-9/.:]+)$'.
    • This allows the parser to match any interface name, accommodating various naming conventions and ensuring that all interfaces are properly captured.
  • Introduced in_interfaces_section flag for accurate section tracking:
    • Initialized in_interfaces_section = False at the beginning of the parsing process.
    • Set in_interfaces_section = True upon encountering the Interfaces: line.
    • Used this flag to determine when interface lines should be parsed.
    • When a non-interface line is encountered within the Interfaces section, set in_interfaces_section = False
    • This ensures that the parser continues to process the current line with other parsing rules, preventing the omission of critical sections like address families and route targets.

Motivation and Context

Replaced the previous regex that relied on specific interface prefixes (e.g., Gi, Bun, Ten, etc.) with a more general pattern

Checklist:

  • I have updated the changelog.
  • I have updated the documentation (If applicable).
  • I have added tests to cover my changes (If applicable).
  • All new and existing tests passed.
  • All new code passed compilation.

Closes #910

@Kani999 Kani999 requested a review from a team as a code owner November 8, 2024 09:48
@Kani999

This comment was marked as resolved.

- Implemented a general regex pattern to capture all interface names
    - Replaced the previous regex that relied on specific interface prefixes (e.g., Gi, Bun, Ten, etc.) with a more general pattern `r'^(?P<intf>[A-Za-z][-A-Za-z0-9/.:]+)$'`
- Introduced `in_interfaces_section` flag for accurate section tracking
@Kani999 Kani999 force-pushed the fix_interfaces_iosxr_show_vrf_all_detail branch from 63f819c to db62997 Compare December 2, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IOS-XR] show vrf all detail parser - Interfaces list not captured
1 participant