Fix nxos sh license usage for nxos 10+#2296
Fix nxos sh license usage for nxos 10+#2296mjbear wants to merge 2 commits intonetworktocode:masterfrom
Conversation
|
Hello @mjbear. Just checking in to see if you’re planning to merge this PR, as we need it for our deployment. |
| ^\s*$$ | ||
| ^. -> Error | ||
|
|
||
| Version10 |
There was a problem hiding this comment.
Does this apply to the command output for all versions of NXOS? If not, should we add this line or block of text as conditional?
matt852
left a comment
There was a problem hiding this comment.
Added 1 comment requesting clarification
| ^. -> Error | ||
|
|
||
| Version10 | ||
| ^\s+Status:\s+${STATUS}$$ |
There was a problem hiding this comment.
| ^\s+Status:\s+${STATUS}$$ | |
| ^\s*$$ | |
| ^\s+Status:\s+${STATUS}$$ |
The Version10 state is missing ^\s*$$ to handle blank lines. The raw test file (cisco_nxos_show_license_usage_ver10.raw) contains blank lines (line 1 is blank, line 4 is blank between sections). Without this, the ^. -> Error directive would trigger on those blank lines — though actually blank lines won't match ^. since . doesn't match empty. Let me re-check: ^\s*$$ is still needed because a line with only whitespace would match ^. and trigger Error. Looking at the raw file, line 1 appears to be a truly empty line and line 4 appears empty. An empty line won't match ^. (since . requires at least one character), but a line with trailing spaces would. To be safe and consistent with repository standards, ^\s*$$ should be added to the Version10 state.
| Version10 | ||
| ^\s+Status:\s+${STATUS}$$ | ||
| # overall License Authorization Status | ||
| ^\s+Status:\s+\S+ |
There was a problem hiding this comment.
| ^\s+Status:\s+\S+ | |
| ^\s+Status:\s+.+ |
Fix the non-capturing status fallback regex to handle multi-word values:
resolves #2285
Fix and add support for NX-OS version 10+
show license usageoutput.