Skip to content
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

Add support for 7.x, multi-digit 9.x, and 10.x Nexus 9000v versions #77

Merged
merged 1 commit into from
May 1, 2022

Conversation

ChristopherJHart
Copy link

As the title suggests, this PR adds support for 7.x, multi-digit 9.x, and 10.x Nexus 9000v/9300v/9500v software images by enhancing the regular expression pattern used to extract the NX-OS software version (which is subsequently used to tag Nexus 9000v/9300v/9500v Docker images). The lack of support for these images was reported in #75.

This has been tested on a variety of image files through the following shell commands:

christopher@ubuntu-vm:~$ echo nxosv-final.7.0.3.I7.5a.qcow2 | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
7.0.3.I7.5a
christopher@ubuntu-vm:~$ echo nxosv-final.7.0.3.I7.9.qcow2 | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
7.0.3.I7.9
christopher@ubuntu-vm:~$ echo nxosv.9.2.1.qcow2 | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
9.2.1
christopher@ubuntu-vm:~$ echo nxosv.9.2.4.qcow2 | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
9.2.4
christopher@ubuntu-vm:~$ echo nexus9300v.9.3.9.qcow2 | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
9.3.9
christopher@ubuntu-vm:~$ echo nexus9300v.9.3.10.qcow2 | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
9.3.10
christopher@ubuntu-vm:~$ echo nexus9300v64.10.2.2.F.qcow | sed -e 's/.\+\?\.\(\(7\.0\.3\.I[0-9]\.[0-9a-z]\+\)\|\([0-9]\+\.[0-9]\+\.[0-9]\+\)\)\(\..*\|$$\)/\1/'
10.2.2
christopher@ubuntu-vm:~$

Add support for 7.x, multi-digit 9.x, and 10.x Nexus 9000v versions
@hellt
Copy link
Owner

hellt commented May 1, 2022

thanks @ChristopherJHart,
valuable improvement!

@adudek16
Copy link

Interesting... The sed version in OSX 11.7 does not like it.
I would update this to allow for the trailing letters in the 10.2.2.F versions..

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.

3 participants