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

show interface summary #539

Merged
merged 4 commits into from
Nov 17, 2019
Merged

show interface summary #539

merged 4 commits into from
Nov 17, 2019

Conversation

timjsmith24
Copy link
Contributor

ISSUE TYPE
  • New Template Pull Request
COMPONENT

cisco_wlc_ssh_show_interface_summary.template, .*, cisco_wlc_ssh, show interface summary

SUMMARY

Value TYPE (\w+)
Value AP_MGR (\w+)
Value GUEST (N\/A|\w+)

Copy link
Contributor

Choose a reason for hiding this comment

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

Here is the changes to the template that I would make:

Value Filldown INT_COUNT (\d+)
Value Required NAME (\S+)
Value PORT (\S+)
Value VLAN (\S+)
Value IP_ADDR (([\d1-9]+\.?){4})
Value TYPE (\S+)
Value AP_MGR (\S+)
Value GUEST (\S+)

Start
  ^\s+Number\sof\sInterfaces\.*\s${INT_COUNT}s*$$
  ^Interface\s+Name\s+Port\s+Vlan\s+Id\s+IP\s+Address\s+Type\s+Ap\s+Mgr\s+Guest -> Type_One

Type_One
  ^-+\s
  ^${NAME}\s+${PORT}\s+${VLAN}\s+${IP_ADDR}\s+${TYPE}\s+${AP_MGR}\s+${GUEST}$$ -> Record
  ^\s*$$
  ^. -> Error

Changed most of the value's regex to \S+ as it should suffice here and catch any non-whitespace on and not depend on if it's a word or not.

I also changed it to track the whole header and then transition state to Type_One if the header matches. This allows us to make sure we're capturing the the correct and expected output. If the headers or output changes, we would add another line to match it and transition to a different state to capture the changed output.

I also added Required to Value NAME to prevent us from having the non-filled in information within the .parsed file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops. Could you add the following to the Start state:

  ^\s*$$
  ^. -> Error

@FragmentedPacket FragmentedPacket added changes_requested Waiting on user to address feedback New Template labels Nov 11, 2019
Value TYPE (\w+)
Value AP_MGR (\w+)
Value GUEST (N\/A|\w+)

Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops. Could you add the following to the Start state:

  ^\s*$$
  ^. -> Error

@jmcgill298 jmcgill298 merged commit 07b69a6 into networktocode:master Nov 17, 2019
@timjsmith24 timjsmith24 deleted the show_inventory_sum branch November 25, 2019 18:55
thomasblass pushed a commit to thomasblass/ntc-templates that referenced this pull request Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes_requested Waiting on user to address feedback New Template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants