-
Notifications
You must be signed in to change notification settings - Fork 63
Nokia SrOS Parser #106
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
Nokia SrOS Parser #106
Conversation
…arents In order to allow the config section banners to be used for specifying a section in parsing I've simplified it so those banner names are the parent for the section. Should allow for a user to specify "System Configuration" for a section and get the full block.
Realized I could use the inherited method just as well as the one I'd written so getting rid of unnecessary code.
| @@ -0,0 +1,5562 @@ | |||
| exit all | |||
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.
Does it make sense to include this in the example? I am a bit torn (if I understand this correctly), what is the expected result, but we should be purposeful in our decision.
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.
I was simply copying this example from @h4ndzdatm0ld TTP repo with the assumption this is a standard format for configurations.
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.
@itdependsnetworks @jdrew82 I am happy to share a ContainerLab setup with a Nokia SROS device for the team to use for current and future testing or integrations, etc. If interested, please let me know. Also, the basic 'show config' (admin display-config) equivalent of SROS will always include exit all at the end.
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.
Also, on the needing more configs to test, I could dig up some old configs but they will need some sanitizing.
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.
that would be great.
|
Looking good, but we def need more config tests. |
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, thanks!
tests/unit/mock/config/compliance/compliance/nokia_sros/sros_basic_feature.py
Show resolved
Hide resolved
Updated test to use post-processed config for the test
|
Approved this PR, the final test that was added was properly being sent in as post processed config for SROS. |
| line (str): A config line from the device that has been found to be a section title. | ||
|
|
||
| Returns: | ||
| str|bool: The section's title from the section banner, else False. |
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.
I never thought about adding the | to specify or. That's cool.
Here's my second attempt at a parser for Nokia SrOS. This time, I'm using the tab indented format that is standard for their configuration backups. This uses the standard space-based parser but also uses the section banners as parents for the section stripping out the section title from the 'echo "System Configuration"` portion. This theoretically allows the end-user to simply put in "System Configuration" when wanting to compare sections and it should parse the full block.