-
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
Properly detect Cumulus Linux platform / version #921
Conversation
2357617
to
3106626
Compare
Detect cumulus Linux systems if they have /etc/cumulus directory. Use platform of ‘cumulus’ and platform_family debian since it’s Debian 8.5. Parse version from their config directory. Signed-off-by: Tim Smith <tsmith@chef.io>
@@ -187,6 +225,12 @@ | |||
expect(@plugin[:platform]).to eq("slackware") | |||
expect(@plugin[:platform_family]).to eq("slackware") | |||
end | |||
|
|||
it "should set platform_version on slackware" do |
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.
This was missing so I figured I should add it while I was here
Signed-off-by: Tim Smith <tsmith@chef.io>
Check the more popular platforms first since those are most likely to match. Parallels have to come before RHEL though since it looks like RHEL. Signed-off-by: Tim Smith <tsmith@chef.io>
if platform == "cumulus" | ||
if File.exist?("/etc/cumulus/etc.replace/os-release") | ||
release_contents = File.read("/etc/cumulus/etc.replace/os-release") | ||
release_contents.match(/VERSION_ID=(.*)/)[1] rescue 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.
maybe you want the warning below here as well instead of a nil rescue
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.
Probably. I keep going back and forth with how much Ohai should warn when things don't go right. Recently leaning more to towards Ohai being verbose when things fail so that people see that things are failing and file issues. We have a lot of hidden failures right now, which doesn't help anyone.
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.
I fully support you doing the right thing, whatever that is.
@btm does that last commit work for you? |
Signed-off-by: Tim Smith <tsmith@chef.io>
end | ||
|
||
# | ||
# Determines the platform_family based on the platform_family |
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.
"based on the platform"
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.
I like my wording better ;)
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.
Determines the platform_family based on the platform family? :)
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.
yeah, avoiding blanket rescue's always feels good.
Signed-off-by: Tim Smith <tsmith@chef.io>
Description
Detect cumulus Linux systems if they have /etc/cumulus directory. Use platform of ‘cumulus’ and platform_family debian since it’s Debian 8.5. Parse version from their config directory.
Issues Resolved
N/A
Check List