-
Notifications
You must be signed in to change notification settings - Fork 449
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
Detect F5 Big-IPs as platform bigip #1035
Conversation
They're RHEL + a bunch of secret sauce. Put them in the RHEL platform family, detect the platform properly, and parse the platform version so it doesn't get the RHEL platform version instead. Signed-off-by: Tim Smith <[email protected]>
angrysauce CI tests |
Oh I knew that would blow up. If there's no objections to this PR I'll go fix the specs |
def bigip_version | ||
release_contents = File.read("/etc/f5-release") | ||
release_contents.match(/BIG-IP release (\S*)/)[1] # http://rubular.com/r/O8nlrBVqSb | ||
rescue NoMethodError, Errno::ENOENT, Errno::EACCES # rescue regex failure, file missing, or permission denied |
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.
An explanation since it took me a moment: The NoMethodError catches the regex failure because String#match returns nil
if there was no match and []
isn't a method on nil
.
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.
LGTM. It appears you have a billion mocks to update.
Signed-off-by: Tim Smith <[email protected]>
Or just 1! :D |
They're RHEL + a bunch of secret sauce. Put them in the RHEL platform family, detect the platform properly, and parse the platform version so it doesn't get the RHEL platform version instead.
Signed-off-by: Tim Smith [email protected]