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

Use /etc/os-release for SUSE detection #476

Closed
wants to merge 3 commits into from

Conversation

russellcardullo
Copy link
Contributor

Description

The file /etc/SuSE-release was deprecated in older SUSE versions and as of SUSE/SLES 15.X is no longer present. This switches the detection to use the values in /etc/os-release.

Related Issue

#377

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

Moves the windows test into it's own block since it's
not part of the set of debian tests.

Signed-off-by: Russell Cardullo <russellcardullo@gmail.com>
The /etc/SuSE-release file was deprecated in older SUSE
versions and as of openSUSE/SLES 15.X is no longer present
on these systems.

This changes the detection methods to use /etc/os-release
which should be present on new as well as older systems.

Signed-off-by: Russell Cardullo <russellcardullo@gmail.com>
@tas50
Copy link
Contributor

tas50 commented Jul 12, 2019

/etc/os-release is definitely the preferred detection place, but I believe SLES 11 doesn't have this file so this would break SLES 11 detection.

@russellcardullo
Copy link
Contributor Author

@tas50 thanks, agreed we definitely shouldn’t break versions without that file. I think I can add back the old detection as a fallback and will test that out.

@tas50
Copy link
Contributor

tas50 commented Jul 12, 2019

Take a look at how we're doing this in Ohai. It starts with /etc/os-release and falls back to all the old configs. https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/platform.rb

Older versions of SUSE won't have the /etc/os-release file
so fallback to the /etc/SuSE-release file in those cases.

Signed-off-by: Russell Cardullo <russellcardullo@gmail.com>
@russellcardullo
Copy link
Contributor Author

russellcardullo commented Jul 12, 2019

@tas50 I added the fallback code back in which will get used when /etc/os-release is not present. I looked as far back as SUSE 10.X and the format of those files should work with the code here, but let me know if there are any other issues that could show up.

Copy link
Contributor

@tas50 tas50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge at this point with a rebase.

@clintoncwolfe
Copy link
Contributor

Thanks @russellcardullo for this PR! I've adopted it as #505, and performed a rebase - should be merged shortly. Thanks again!

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.

4 participants