Skip to content

Fix nxos sh license usage for nxos 10+#2296

Closed
mjbear wants to merge 2 commits intonetworktocode:masterfrom
mjbear:nxos_sh_lic_usage_issue2285
Closed

Fix nxos sh license usage for nxos 10+#2296
mjbear wants to merge 2 commits intonetworktocode:masterfrom
mjbear:nxos_sh_lic_usage_issue2285

Conversation

@mjbear
Copy link
Copy Markdown
Collaborator

@mjbear mjbear commented Mar 12, 2026

resolves #2285

Fix and add support for NX-OS version 10+ show license usage output.

Copy link
Copy Markdown
Contributor

@jvanderaa jvanderaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@michalis1
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a State for the items that appear to apply to NXOS version 10+

Copy link
Copy Markdown
Contributor

@matt852 matt852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 1 comment requesting clarification

Copy link
Copy Markdown
Contributor

@matt852 matt852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjbear Please review suggestions and update if applicable.

^. -> Error

Version10
^\s+Status:\s+${STATUS}$$
Copy link
Copy Markdown
Contributor

@matt852 matt852 Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s+Status:\s+${STATUS}$$
^\s*$$
^\s+Status:\s+${STATUS}$$

^\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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this.
For this line it was mirroring of some existing template lines.

Version10
^\s+Status:\s+${STATUS}$$
# overall License Authorization Status
^\s+Status:\s+\S+
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s+Status:\s+\S+
^\s+Status:\s+.+

Fix the non-capturing status fallback regex to handle multi-word values:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this one, it depends on what we're willing to be captured.
The suggested regex allows far more character types to be matched.

@matt852
Copy link
Copy Markdown
Contributor

matt852 commented Mar 30, 2026

Closing due to duplicate PR 2302 completed and merged due to time-sensitive nature of needing these changes.
@mjbear please review that PR and submit any suggested changes as needed please.

@matt852 matt852 closed this Mar 30, 2026
@mjbear
Copy link
Copy Markdown
Collaborator Author

mjbear commented Mar 30, 2026

Closing due to duplicate PR 2302 completed and merged due to time-sensitive nature of needing these changes. @mjbear please review that PR and submit any suggested changes as needed please.

Hi all,
If I'm not responding because I'm busy, I'm absolutely in favor of anyone (ex: maintainers) to carry the torch and add to my PR. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cisco nxos >v10 changed output for show license usage

4 participants