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

eos: refactor vrf parsing #1923

Merged
merged 5 commits into from
May 23, 2023
Merged

eos: refactor vrf parsing #1923

merged 5 commits into from
May 23, 2023

Conversation

bewing
Copy link
Member

@bewing bewing commented May 15, 2023

Add a fixed width table parser to base string utilities. Use the known dashed line to discern field widths of VRF text output. Use those values instead of TextFSM/regex parsing of the output to determine VRF RD and interface assignments.

If EOS version >= 4.23.0, just use the dang json

Resolves #1922 and #1919

@bewing bewing self-assigned this May 15, 2023
@bewing bewing force-pushed the issue-1922 branch 11 times, most recently from 371757e to 0334382 Compare May 15, 2023 22:04
@bewing bewing marked this pull request as ready for review May 15, 2023 22:09
@bewing bewing marked this pull request as draft May 16, 2023 00:56
@bewing bewing marked this pull request as ready for review May 16, 2023 21:52
@bewing bewing force-pushed the issue-1922 branch 2 times, most recently from 502dfbb to 673a1f5 Compare May 17, 2023 05:18
bewing added 5 commits May 22, 2023 09:45
Add a fixed width table parser to base string utilities.  Use the known
dashed line to discern field widths of VRF text output.  Use those
values instead of TextFSM/regex parsing of the output to determine VRF
RD and interface assignments.
I believe when I first collected the output for this test case 6 years
ago, I didn't actually collect it from a router, and may have just
copied an existing text file and edited it manually.  This is an issue
since we are trying to switch to fixed-width column parsing for the
output.  I have hand-edited it this time to match the format and spacing
of the other test cases, as I do not have access to the router or config
that was used as the source for this test case.
If version of EOS is new enough (>= 4.23.0), use the JSON output of
"show vrf" to avoid issues with text parsing in 4.28+

Anecdotal evidence suggests that "default" was added to the text output
of "show vrf" in 4.23, so this also resolves the double route issue in
1919.

closes #1919
Copy link
Contributor

@ktbyers ktbyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bewing bewing merged commit b64d005 into develop May 23, 2023
@ktbyers ktbyers deleted the issue-1922 branch February 28, 2024 18:27
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.

get_network_instances does not return expected results
2 participants