-
Notifications
You must be signed in to change notification settings - Fork 452
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
Fix openSUSE leap and SLES detection in Chef 14 #1377
Conversation
Clear Linux OS also ships a /etc/os-release file. A check for /usr/lib/os-release file returns true for openSUSE Leap and SLES distributions, but we are not handling them in that block. It is easier just to move Clear Linux check to /etc/os-release. Left the existing code block there to handle any weird edge cases where /usr/lib/os-release exists but /etc/os-release doesn't. Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
8074e8e
to
320a6b5
Compare
@@ -266,7 +266,8 @@ def determine_platform_family | |||
elsif File.exist?("/etc/alpine-release") | |||
platform "alpine" | |||
platform_version File.read("/etc/alpine-release").strip | |||
elsif File.exist?("/usr/lib/os-release") | |||
# If /etc/os-release file exists, we take that as source of truth | |||
elsif File.exist?("/usr/lib/os-release") && !File.exist?("/etc/os-release") |
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.
@tas50 Does this make sense? && !File.exist?("/etc/os-release")
essentially ensures openSUSE Leap and SLES not match with this check.
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.
CI failures doesn't seem related to my change. 🤔
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Thanks @balasankarc |
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. |
Detection of openSUSE leap and SLES distributions fail with Chef 14 because these distributions satisfy the
if File.exist?('/usr/lib/os-release')
check. However, in that check, we only consider Clear Linux and not anything else, thus causing detection to fail for any other OS.In my experiments, all the Clear Linux distributions provided
/etc/os-release
file also. So, moving Clear Linux detection to be based on that file, and using/usr/lib/os-release
only if/etc/os-release
is not found (to handle any weird edge cases out there) seems like a safe option to handle Clear Linux, openSUSE Leap and SLES.Related Issue
#1343
Types of changes
Checklist: