-
Notifications
You must be signed in to change notification settings - Fork 63
Add ASA Parser #16
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
Add ASA Parser #16
Conversation
netutils/config/parser.py
Outdated
| banner_start = [] | ||
|
|
||
|
|
||
| class ASAConfigParser(CiscoConfigParser, BaseSpaceConfigParser): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CiscoConfigParser already inherits from BaseSpaceConfigParser, e.g. class CiscoConfigParser(BaseSpaceConfigParser):
This should suffice class ASAConfigParser(CiscoConfigParser):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to using IOSConfigParser as an example and it inherits from those two classes. I will correct it.
|
Can you add tests/mocked examples for all of the compliance functions? e.g. in folder |
|
I'll work on getting those tests added today. |
jeffkala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
| ... ] | ||
| True | ||
| """ | ||
| for line in self.generator_config: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmcgill298 Can you give this a quick review? I get lost a little bit what this is doing, but it seems like there is a logical reason to overwrite this method.
Please feel free to review entire PR as everything looks good to me and I am inclined to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was overwritten because the ASA does the banner differently. Instead of needing to parse it like it's a single line with a delimiter, you can just parse each line individually like normal since each line always starts with the banner keyword, ie:
banner motd <BANNER TEXT>
banner exec <BANNER TEXT>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!! That makes sense.
This is an initial attempt at a parser for ASAs to address #10.