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

IOSXR: fix "show route ipv4" parser for hops without interface #529

Merged

Conversation

vincentbernat
Copy link
Contributor

"show route ipv4" may not provide an interface for each hop, like in
this example:

B    10.0.0.0/8 [20/30] via 172.19.165.189, 3w0d
                [20/0] via 172.30.254.254, 3w0d

Fix the regex to handle this case correctly. Previously, 3w0d was
considered to be the interface. The regex was stolen from the IPv6
case which was correct (and tested).

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.

Copy link
Contributor

@tahigash tahigash left a comment

Choose a reason for hiding this comment

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

thanks for the fix. left one comment.

src/genie/libs/parser/iosxr/show_routing.py Show resolved Hide resolved
Copy link
Contributor

@d-the-iii d-the-iii left a comment

Choose a reason for hiding this comment

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

Fix looks good to me, but I agree with Takashi. Do you have an example of this line without the interface so we can manually test the regex, and to make unit tests with?

"show route ipv4" may not provide an interface for each hop, like in
this example:

```
B    10.0.0.0/8 [20/30] via 172.19.165.189, 3w0d
                [20/0] via 172.30.254.254, 3w0d
```

Fix the regex to handle this case correctly. Previously, `3w0d` was
considered to be the interface. The regex was stolen from the IPv6
case which was correct (and tested).
Copy link
Contributor

@tahigash tahigash left a comment

Choose a reason for hiding this comment

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

thanks for addressing comments and contribution!

@d-the-iii d-the-iii self-requested a review September 13, 2021 13:54
@d-the-iii d-the-iii merged commit 7b34d59 into CiscoTestAutomation:master Sep 15, 2021
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.

3 participants