summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ohai/plugins/linux/platform.rb3
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 3433bdf2..492c61ee 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -149,7 +149,8 @@ Ohai.plugin(:Platform) do
"rhel"
when /amazon/
"amazon"
- when /suse/, /sles/, /opensuseleap/, /opensuse/, /sled/
+ # suse matches opensuse, suse-* opensuse-*, etc. sle[sd\-_] intends to match sles, sled, sle-*, sle_*
+ when /suse/, /sle[sd\-_]/
"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
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index 8d27e211..b3c0dbdc 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -181,7 +181,7 @@ describe Ohai::System, "Linux plugin platform" do
end
end
- %w{suse sles opensuse opensuseleap sled}.each do |p|
+ %w{suse sles opensuse opensuse-leap opensuseleap opensuse-tumbleweed opensuse-leap-micro opensuse-microos suse-microos sled sle-hpc sle_hpc sle_rt}.each do |p|
it "returns suse for #{p} platform_family" do
expect(plugin.platform_family_from_platform(p)).to eq("suse")
end