Skip to content

adjust parser for IOSXE 'show running-config aaa username' to be less rigid #937

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thepurplebuffalo
Copy link

Description

This change adjusts how the IOSXE parser for show running-config aaa username works.

Motivation and Context

I recently encountered a problem where this username line was skipped by the parser:

username testuser8 privilege 15 common-criteria-policy Test-CC secret 9 <hash>

The existing regular expressions (8 of them) each match entire username lines that meet a specific format. The line above did not match any of those expressions. The result was that the username was silently skipped by the parser. None of the 8 existing regular expressions allow for both privilege and common-criteria-policy on the same line.

I have changed the general nature of this parser to treat the username line like a stack. Arguments are popped off of the beginning of the line (along with their parameters) so that the arguments can exist in flexible combinations.

This code is untested as the project Makefile relies on resources internal to Cisco.

Impact (If any)

Screenshots:

None.

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.

@thepurplebuffalo thepurplebuffalo requested a review from a team as a code owner March 28, 2025 10:14
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.

1 participant