summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Yang <james.yang@email.ucr.edu>2022-08-09 12:35:17 -0700
committerGitHub <noreply@github.com>2022-08-09 12:35:17 -0700
commitc7a45470b38a66a0a49504ac833e3bfc684ba5dd (patch)
tree0844d8964df32f83553279147d8f0d102aeb6b93
parent37d9fc5dbc1dfdcbf6680993e1173ddc93549c85 (diff)
downloadohai-c7a45470b38a66a0a49504ac833e3bfc684ba5dd.tar.gz
Add additional SUSE and openSUSE platforms - micro, hpc (#1753)
* Add additional SUSE and openSUSE platforms - micro, hpc Signed-off-by: jamesongithub@users.noreply.github.com <jamesongithub@users.noreply.github.com>
-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