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

Fixed regex for fortinet bgp template and added new template standards #592

Merged
merged 2 commits into from
Feb 9, 2020

Conversation

corvese
Copy link
Contributor

@corvese corvese commented Feb 9, 2020

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT
  • Name of template: fortinet_fortios_get_router_info_bgp_summary.textfsm
  • OS: Fortinet FortiOS
  • Command: get router info bgp summary
SUMMARY

This fixes an issue with some of the output returned from the get router info bgp summary command on fortinet fortios. Sometimes time returned output from the device has ":" in the UP_DOWN portion (i.e. 05:48:47). The previous regex did not account for the ":" character. I have updated that with this PR

Additionally, I have updated the template to account for all potential lines of output from the command, finishing on an error state if a line is presented without a regex match.

@corvese corvese requested a review from jmcgill298 February 9, 2020 01:23
@@ -1,9 +1,15 @@
Value BGP_NEIGH (\d+?\.\d+?\.\d+?\.\d+?)
Value NEIGH_AS (\d+)
Value UP_DOWN (\w+)
Value UP_DOWN ((?:\w|:)*)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth it to change to \S+ to capture anything non-whitespace? This should hopefully prevent us from having to worry too much about any format changes for it.

Value STATE_PFXRCD (\w+)

Start
^BGP router identifier.*$$
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind changing the static spaces to \s+?

@FragmentedPacket FragmentedPacket added bug changes_requested Waiting on user to address feedback labels Feb 9, 2020
@corvese
Copy link
Contributor Author

corvese commented Feb 9, 2020

@FragmentedPacket, thank you for your feedback. I have made the requested changes. Please let me know if there's anything else that may need improvement.

@FragmentedPacket FragmentedPacket merged commit ab89436 into networktocode:master Feb 9, 2020
@FragmentedPacket
Copy link
Contributor

@ccorvese Thanks for another contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug changes_requested Waiting on user to address feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants