Fix IOS show env power parser#2270
Conversation
Thank you for your submission and fix. There's a little bit more needed to qualify this PR ready for review and merging.
If there are any questions, please ask. Thank you! |
… "\w". Tested on a Cisco C9300 Add test case
e64d8b1 to
2f532d9
Compare
Hi @mjbear, thanks for helping me through the process. I've added a test case with both the raw output and a YAML file. The test seems to succeed. |
Decided to add more test data.
I will need to re-review after that.
It is possible to shorten "show environment" to "show env". Not only that, but on older platforms it is env and not the full word environment.
- Support trailing space after watts - 3750x has a trailing slash number after watts (ex: 350/0)
Older switches such as 2960-S, 2960-X, and 3750G have built-in PSUs which show up differently.
|
I saw the comment from the previous contributor that is getting removed regarding "works on 3850, but not 3750". 😅 I decided to poke at some other hardware to round out the support. 😱 Oh and this is one of those (existing) templates without the Error directive. The index pattern can be shortened to Here's a list of things I changed and pushed to your PR/branch.
|
|
@itdependsnetworks @jmcgill298 @jvanderaa @matt852 |
|
I'm tempted that we shouldn't reduce the command length matching part. There are likely other platforms that may have a command issue there. @itdependsnetworks / @jmcgill298 I'm going to need some of your thoughts there. |
|
LGTM. Even if newer versions have two different commands that start with env, then the user would have to add the fourth letter, and then that would not match the pattern in the index |
On a non-PoE switch, "PoE Pwr" will display "n/a", which won't match "\w". Changed to match non-whitespace "\S". Tested on a bunch of Cisco C9300s
Also: