-
Notifications
You must be signed in to change notification settings - Fork 453
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 platform_version detection on Fedora rawhide #1396
Conversation
@@ -53,7 +53,7 @@ def get_redhatish_platform(contents) | |||
# @returns [String] the version string | |||
# | |||
def get_redhatish_version(contents) | |||
contents[/Rawhide/i] ? contents[/((\d+) \(Rawhide\))/i, 1].downcase : contents[/(release)? ([\d\.]+)/, 2] |
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.
Can you add a spec here so we make sure we don't regress this later on. Also it's really useful to add a https://rubular.com/ permalink to the comments that shows the various things the regex is trying to match. That way anyone trying to adjust this regex later on can easily test the matches. We try to add those any time we touch a regex now.
- lib/ohai/provides_map.rb:34:1: C: Layout/EmptyLines: Extra blank line detected. - lib/ohai/system.rb:136:1: C: Layout/EmptyLines: Extra blank line detected. Signed-off-by: Ritesh Khadgaray <ritz@fb.com>
lib/ohai/plugins/linux/platform.rb
Outdated
# CentOS release 5.8 (Final) | ||
# CentOS release 6.7 (Final) | ||
# Red Hat Enterprise Linux Server release 7.5 (Maipo) | ||
# | ||
# Red Hat Enterprise Linux release 8.0 (Ootpa) |
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.
You can replace all these examples with this:
# See https://rubular.com/r/78c1yXYa7zDhdV for example matches
- do not capture "rawide" string in platform_version Signed-off-by: Ritesh Khadgaray <ritz@fb.com>
@ritzk I just realized that you're running Chef 14. In Chef 15 the whole platform detection logic was reworked to just use /etc/os-release. This method won't actually be used on Fedora anymore. The fix is still solid, but upgrade Chef/Ohai and you'll be good to go. |
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. |
package resource fails on rawhide. The updated regex - https://rubular.com/r/3JaKsAeOMLbszj , to only return the version string.
Description
package resource fails on fedora rawhide with the below message.
the section which fails
The stacktrace
Related Issue
Similar one - #1218
Types of changes
Checklist: