summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-03-12 23:35:49 -0800
committerTim Smith <tsmith84@gmail.com>2021-03-13 16:46:46 -0800
commit771a034fdc9c9860d8c8d5d289615056ea74e8f6 (patch)
treeb4f123230cced804507e03681dc15ce9d3823a17
parent319318dcb05ff667cf0dfb25376adac4d0f17bfa (diff)
downloadohai-platform_order.tar.gz
Stick the common matched platforms firstplatform_order
Nothing super scientific here, but it's about 10% faster to match if the data is hit sooner. Stick the super obscure stuff last. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/linux/platform.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 15876e07..26502139 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -134,10 +134,10 @@ Ohai.plugin(:Platform) do
#
def platform_family_from_platform(plat)
case plat
- when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/, /kali/, /pop/
+ when /ubuntu/, /debian/, /linuxmint/, /raspbian/, /cumulus/, /kali/, /pop/
# apt-get+dpkg almost certainly goes here
"debian"
- when /oracle/, /centos/, /redhat/, /almalinux/, /scientific/, /enterpriseenterprise/, /xenserver/, /xcp-ng/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/, /alibabalinux/, /sangoma/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
+ when /centos/, /redhat/, /oracle/, /almalinux/, /scientific/, /enterpriseenterprise/, /xenserver/, /xcp-ng/, /cloudlinux/, /alibabalinux/, /sangoma/, /clearos/, /parallels/, /ibm_powerkvm/, /nexus_centos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
# NOTE: "rhel" should be reserved exclusively for recompiled rhel versions that are nearly perfectly compatible down to the platform_version.
# The operating systems that are "rhel" should all be as compatible as rhel7 = centos7 = oracle7 = scientific7 (98%-ish core RPM version compatibility
# and the version numbers MUST track the upstream). The appropriate EPEL version repo should work nearly perfectly. Some variation like the
@@ -149,7 +149,7 @@ Ohai.plugin(:Platform) do
"rhel"
when /amazon/
"amazon"
- when /suse/, /sles/, /opensuse/, /opensuseleap/, /sled/
+ when /suse/, /sles/, /opensuseleap/, /opensuse/, /sled/
"suse"
when /fedora/, /arista_eos/
# In the broadest sense: RPM-based, fedora-derived distributions which are not strictly re-compiled RHEL (if it uses RPMs, and smells more like redhat and less like
@@ -159,8 +159,6 @@ Ohai.plugin(:Platform) do
"wrlinux"
when /gentoo/
"gentoo"
- when /slackware/
- "slackware"
when /arch/, /manjaro/
"arch"
when /exherbo/
@@ -171,6 +169,8 @@ Ohai.plugin(:Platform) do
"clearlinux"
when /mangeia/
"mandriva"
+ when /slackware/
+ "slackware"
end
end