-
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
/etc/os-release based OS detection #1299
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We need to correctly read in the data in /etc/os-release and do the right thing. We already did this for SLES 15. Signed-off-by: Tim Smith <tsmith@chef.io>
50339fb
to
648a0f8
Compare
This is the modern way of identifying Linux platforms and versions. It's far more reliable than the brittle regex mess that we have built up over the last decade. It also allows us to easily detect unknown / obscure distros. Signed-off-by: Tim Smith <tsmith@chef.io>
648a0f8
to
0d842f7
Compare
Get ready to refactor these Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
This avoids the need to test the full plugin run on each of these platforms and it keeps us from accidentally breaking something here later on. Signed-off-by: Tim Smith <tsmith@chef.io>
We test this better now Signed-off-by: Tim Smith <tsmith@chef.io>
These are modern operating systems that will always use the new os-release logic: Fedora, Arch, Linux Mint, raspbian, amazon 2, clearos Signed-off-by: Tim Smith <tsmith@chef.io>
Break out more logic into simpler methods that can be tested Signed-off-by: Tim Smith <tsmith@chef.io>
Avoid having to search path when it's always in the same path Signed-off-by: Tim Smith <tsmith@chef.io>
I've confirmed this works on a cumulus system. Not sure where the previous logic came from. Signed-off-by: Tim Smith <tsmith@chef.io>
This is wrong, but it's what we've been doing for a while Signed-off-by: Tim Smith <tsmith@chef.io>
This is faster and also easier to read Signed-off-by: Tim Smith <tsmith@chef.io>
These systems always have an os-release file. No need for the legacy method. Signed-off-by: Tim Smith <tsmith@chef.io>
Nothing supported here lacks os-release files Signed-off-by: Tim Smith <tsmith@chef.io>
Bumps things for the last 10 years Signed-off-by: Tim Smith <tsmith@chef.io>
CentOS doesn't do the right thing with the os-release file. They treat it differently than redhat and every other distro I've seen. We need to work around that. Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
We'll never get to this code since it requires a os-release file Signed-off-by: Tim Smith <tsmith@chef.io>
It's os-release file is not in a standard location Signed-off-by: Tim Smith <tsmith@chef.io>
expect(@plugin[:platform]).to eq("amazon") | ||
expect(@plugin[:platform_family]).to eq("amazon") | ||
describe "#read_os_release_info" do | ||
let(:file_contents) { "COW=MOO\nDOG=\"BARK\"" } |
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.
but what does the fox say?
lamont-granquist
approved these changes
Nov 27, 2018
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/etc/os-release is the modern way of identifying Linux platforms and versions. It's far more reliable than the brittle regex mess that we have built up over the last decade. It also allows us to easily detect unknown / obscure distros since they have platform IDs in the os-release file.
Changes to call out:
Things that change: