Closed alexblaeuer closed 2 months ago
@alexblaeuer Do you have [sanitized] raw cli output for the tag policy summary? (sanitized to remove any potentially sensitive information)
This would be the "SAMPLE COMMAND OUTPUT". I just remove the command itself.
Here with command:
cisco-wlc-1#show wireless tag policy summary
Number of Policy Tags: 10
Policy Tag Name Description
------------------------------------------------------------------------
PT_VIP PT_VIP
PT_Test PT_Test
PT_Mgmt
PT_Media PT_Media
PT_Default PT_Default
PT_Extra
PT_Hallway PT_Hallway
default-policy-tag default policy-tag
@alexblaeuer can you make this a pull request?
This would be the "SAMPLE COMMAND OUTPUT". I just remove the command itself.
@alexblaeuer There are times when a person should turn in for the night and sleep rather than ask something silly. That was me, I should have looked at this issue today. :neutral_face: (My apologies.) :sweat_smile:
Since there's only tag name and description in that raw output you could drop the policy word off the front. That's a preference thing though (and I'm not hard set on that suggestion either).
Excellent catch on handling the missing description!
Since this template is be pretty simple, you could avoid adding an extra State altogether. It reduces a few duplicate lines for the blank lines and error directive.
For example:
Value Required POLICY_TAG_NAME (\S+)
Value DESCRIPTION (.*)
Start
# Skip the header lines
^Number of Policy Tags:.*
^Policy Tag Name\s+Description
^-+
# Start capturing output
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is
^${POLICY_TAG_NAME}\s+${DESCRIPTION} -> Record
# Handle cases where the description is missing
^${POLICY_TAG_NAME} -> Record
# Match blank lines
^\s*$$
# Error out if raw data does not match any above rules.
^. -> Error
EOF
And yeah, you've done all the hard work on the template. Next steps would be to fork, branch, create the files and then run the project tests against your test data (and the rest of the project's test data).
From there like @jmcgill298 says, a PR is next. Congrats!
@mjbear Thank you very much for the inputs, much appreciated 🙏🏼. PR is in the making.
Environment
Proposed Functionality
Adding new textfsm template for show wireless tag policy summary Cisco WLC running Cisco IOS XE
Use Case
Catch the configured Policy Tags on Cisco WLC
TEMPLATE USING
SAMPLE COMMAND OUTPUT
RESULTS