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

[linux/platform] fix platform_version on Debian testing and unstable #1613

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

michel-slm
Copy link
Contributor

@michel-slm michel-slm commented Feb 3, 2021

Description

When this plugin is updated to use /etc/os-release, it introduces a regression
on Debian testing and unstable, where the VERSION_ID field is not set.

In the legacy code path, platform_version is set on Debian by reading
/etc/debian_version; this is still needed on Debian testing and unstable.

Add a special case for Debian, falling back to reading this file rather than
to using uname -r, and update the spec to cover this.

Signed-off-by: Michel Alexandre Salim michel@fb.com

Related Issue

#1612

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • xx] I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

This change is Reviewable

When this plugin is updated to use `/etc/os-release`, it introduces a regression
on Debian testing and unstable, where the `VERSION_ID` field is not set.

In the legacy code path, `platform_version` is set on Debian by reading
`/etc/debian_version`; this is still needed on Debian testing and unstable.

Add a special case for Debian, falling back to reading this file rather than
to using `uname -r`, and update the spec to cover this.

Signed-off-by: Michel Alexandre Salim <michel@fb.com>
@michel-slm michel-slm requested review from a team as code owners February 3, 2021 00:08
Copy link
Collaborator

@jaymzh jaymzh left a comment

Choose a reason for hiding this comment

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

Thanks!

@tas50 tas50 merged commit 51bd6af into chef:master Feb 3, 2021
@tas50
Copy link
Contributor

tas50 commented Feb 3, 2021

Nice fix. Can you open this up against the 16-stable branch so I can make sure it gets included there as well.

@michel-slm
Copy link
Contributor Author

@tas50 absolutely!

@michel-slm
Copy link
Contributor Author

@jaymzh @tas50 #1614

(had to bundle install again and it took a while re-checking-out the Chef repo)

@michel-slm michel-slm deleted the platform-version-debian-testing branch February 3, 2021 00:37
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.

3 participants