-
Notifications
You must be signed in to change notification settings - Fork 781
Create HP Comware display version #2206
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
base: master
Are you sure you want to change the base?
Create HP Comware display version #2206
Conversation
…es with all sorts of variations from both comware 5 and comware 7 Signed-off-by: Cain,Marcus <[email protected]>
|
@marcus-cain Thank you! |
|
@mjbear Thanks! |
…ns. refactored white-space matching to be consistent with other templates to match single-white space character or more '\s+' instead of 0-white space characters. Additionally, improved capturing of model by using a non-greedy approach, which better improves and captures the device model Signed-off-by: Cain,Marcus <[email protected]>
|
@mjbear - I have made some modifications to the template. You can see the difference here: I took your recommendation and got rid of wrapping optional characters in parenthesis. I also consolidated alot of the common/similar regex lines which cleaned up the redundant expressions accordingly. I also replaced white-space character matching with \s+ instead of \s* to capture 1 or more whitespace character, as this is consistent with how other templates are matching white-space The biggest improvement is that i updated the CaptureGroup for model to be a non-greedy. This really helped the data quality for model, because before it was capturing "spaces" and random "power supply and slot" information into the model because of the various ways that comware presents this information. So now with the model being non-greedy, i am able to specify all the various random words that come after the model, but isn't actually part of the model' example: So by taking a non-greedy approach, i was able to capture the model exactly by specifying the random words that comware shows after the model: |
…ware 5 chassis devices. This change is covered by test sets 'cw5_1.yml', 'cw5_2.yml', 'cw5_3.yml'. With this change, comware5 and comware 7 chassis based devices are consistently parsed, where the main board is recognized by empty slot, and the line cards are represented by their slot numbers Signed-off-by: Cain,Marcus <[email protected]>
| software_version: "7.1.045" | ||
| uptime: "171 weeks, 5 days, 15 hours, 39 minutes" | ||
| - last_reboot_reason: "ColdReboot" | ||
| model: "5130-48G-PoE+-4SFP+ (370W) EI JG937A" |
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.
@marcus-cain
This yaml line has the wattage and so forth.
Maybe it didn't get updated?
| software_version: "7.1.045" | ||
| uptime: "497 weeks, 5 days, 15 hours, 4 minutes" | ||
| - last_reboot_reason: "ColdReboot" | ||
| model: "5130 48G 4SFP+ 1-slot HI" |
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 file also has extra characters after the model.
In this case, 1-slot HI
Is this expected @marcus-cain?
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 cw5_1 file seems awful similar to cw5_2 (and thus its raw output too).
Is this correct @marcus-cain?
We should strive to keep test data to the cover the differences and reduce any duplication/redundancy.
In the case I've overlooked any meaningful differences, my apologies.
|
Hi @marcus-cain (Here's a list, but see above for details. Thank you!)
|
@marcus-cain There are a couple of remaining questions I'll link to below.
Thank you! |




Created new template for display version. Added multidude of test files with all sorts of variations from both comware 5 and comware 7
Updated the index file following longest match order