summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRitesh Khadgaray <ritz@fb.com>2019-08-07 13:32:59 -0700
committerRitesh Khadgaray <ritz@fb.com>2019-08-08 09:56:59 -0700
commitebbc9c3eb28e79456359b26e217dda560537672a (patch)
treee35e1cd0282107934b7c6acc98db3f9887f5c47b
parent03d215f7ad515421a2d224b63fa06f124f27fda1 (diff)
downloadohai-ebbc9c3eb28e79456359b26e217dda560537672a.tar.gz
fix platform_version on fedora rawhide
- do not capture "rawide" string in platform_version Signed-off-by: Ritesh Khadgaray <ritz@fb.com>
-rw-r--r--lib/ohai/plugins/linux/platform.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 45f94744..12bc4f7a 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -40,20 +40,14 @@ Ohai.plugin(:Platform) do
contents[/^Red Hat/i] ? "redhat" : contents[/(\w+)/i, 1].downcase
end
- # Amazon Linux AMI release 2013.09
- # Amazon Linux 2
- # Amazon Linux 2 (Karoo)
- # Fedora release 28 (Twenty Eight)
- # CentOS release 5.8 (Final)
- # CentOS release 6.7 (Final)
- # Red Hat Enterprise Linux Server release 7.5 (Maipo)
+ # See https://rubular.com/r/78c1yXYa7zDhdV for example matches
#
# @param contents [String] the contents of /etc/redhat-release
#
# @returns [String] the version string
#
def get_redhatish_version(contents)
- contents[/Rawhide/i] ? contents[/((\d+) \(Rawhide\))/i, 1].downcase : contents[/(release)? ([\d\.]+)/, 2]
+ contents[/(release)? ([\d\.]+)/, 2]
end
#