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

SUSE: Use /etc/os-release if present for all platform attributes #1140

Merged
merged 15 commits into from
Mar 6, 2018

Conversation

yeoldegrove
Copy link
Contributor

@yeoldegrove yeoldegrove commented Feb 26, 2018

Description

Use /etc/os-release (if present) for all platform attributes.

Issues Resolved

Newer linux distributions all have this file, but might not have the legacy *-release fles anmore.
This is for example true for the upcoming SUSE SLES 15.

#1054 This is also related (SLES12)

Check List

@yeoldegrove yeoldegrove requested a review from a team February 26, 2018 17:06
# use os-release (present on all modern linux distros) or use old *-release files as fallback
# platform_family also does not need to be hardcoded anymore
if File.exist?("/etc/os-release")
platform_family os_release_info["ID_LIKE"]
Copy link
Contributor

Choose a reason for hiding this comment

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

platform_family is special - and a huge amount of chef behaviour stems from it. I think we'd still need to run determine_platform_family even in the case where we have /etc/os-release.

@thommay
Copy link
Contributor

thommay commented Feb 26, 2018

I think this is the correct change in general but I'm rather nervous about possible behaviour change due to platform_family.

…lease files as fallback.

os-release will only be used if no other *-release file is present.
We have to do this for compatibility reasons, or older OS releases might get different
"platform" or "platform_version" attributes (e.g. SLES12, RHEL7).

platform_family also does not need to be hardcoded anymore.
This would be the correct way, but we stick with "determine_platform_family" for compatibility reasons.
…lease files as fallback.

os-release will only be used if no other *-release file is present.
We have to do this for compatibility reasons, or older OS releases might get different
"platform" or "platform_version" attributes (e.g. SLES12, RHEL7).

platform_family also does not need to be hardcoded anymore.
This would be the correct way, but we stick with "determine_platform_family" for compatibility reasons.
@yeoldegrove
Copy link
Contributor Author

@thommay I think you're right.
This is the more conservative approach.

Use os-release (present on all modern linux distros) BUT use old *-release files as fallback.

os-release will only be used if no other *-release file is present.
We have to do this for compatibility reasons, or older OS releases might get different
"platform" or "platform_version" attributes (e.g. SLES12, RHEL7).

platform_family also does not need to be hardcoded anymore.
This would be the correct way, but we stick with "determine_platform_family" for compatibility reasons.

Signed-off-by: Eike Waldt <waldt@b1-systems.de>
@yeoldegrove
Copy link
Contributor Author

@tas50 @thommay Is anything missing or can this be merged?

@thommay thommay requested review from lamont-granquist and a team March 5, 2018 14:19
@thommay
Copy link
Contributor

thommay commented Mar 6, 2018

@yeoldegrove needs one more reviewer and then it's good to go.

@tas50 tas50 changed the title use /etc/os-release (if present) for all platform attributes SUSE: Use /etc/os-release if present for all platform attributes Mar 6, 2018
@tas50 tas50 merged commit 94426d8 into chef:master Mar 6, 2018
@tas50
Copy link
Contributor

tas50 commented Mar 6, 2018

Thanks for putting this together and reworking it for us @yeoldegrove

@tas50 tas50 mentioned this pull request Oct 30, 2018
@lock
Copy link

lock bot commented Jan 25, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants