summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-08-08 12:07:54 -0700
committerGitHub <noreply@github.com>2019-08-08 12:07:54 -0700
commit99f5400e0038e8e841149dd59f147928af5124a0 (patch)
tree3eb40280ff449cd2e4c576166240ef15c4958b67
parent1bda24c6a9edf1d3b846e426278df26234b79cff (diff)
parentebbc9c3eb28e79456359b26e217dda560537672a (diff)
downloadohai-99f5400e0038e8e841149dd59f147928af5124a0.tar.gz
Merge pull request #1396 from ritzk/rawhide-version-breakage
Fix platform_version detection on Fedora rawhide
-rw-r--r--lib/ohai/plugins/linux/platform.rb10
-rw-r--r--lib/ohai/provides_map.rb1
-rw-r--r--lib/ohai/system.rb1
3 files changed, 2 insertions, 10 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
#
diff --git a/lib/ohai/provides_map.rb b/lib/ohai/provides_map.rb
index 2bb53d77..e5ed2060 100644
--- a/lib/ohai/provides_map.rb
+++ b/lib/ohai/provides_map.rb
@@ -31,7 +31,6 @@ module Ohai
@map = Mash.new
end
-
# @param [Ohai::DSL::Plugin] plugin
# @param [Array] provided_attributes
#
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index 6a6c7169..6cddf774 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -133,7 +133,6 @@ module Ohai
freeze_strings!
end
-
# @param [String] plugin_path
#
# @return [void]