diff options
author | Tim Smith <tsmith@chef.io> | 2017-06-14 17:03:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-14 17:03:42 -0700 |
commit | 367e075f439a9c372fc510fc88f69866620d7a92 (patch) | |
tree | af346d513adc6f4f1040d2f6748984db865e968a | |
parent | db2fd83bec6a5517a290f310a277c3632848a507 (diff) | |
parent | bbdf084bb8aea261abbc18e497e1060d61fdc187 (diff) | |
download | ohai-367e075f439a9c372fc510fc88f69866620d7a92.tar.gz |
Merge pull request #1004 from chef/add_clearos_rhel_platform_family
Add clearos platform to RHEL platform_family
-rw-r--r-- | lib/ohai/plugins/linux/platform.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/linux/platform_spec.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb index fc9215c4..ae6d6589 100644 --- a/lib/ohai/plugins/linux/platform.rb +++ b/lib/ohai/plugins/linux/platform.rb @@ -107,7 +107,7 @@ Ohai.plugin(:Platform) do case platform when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/ "debian" - when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID" + when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID" "rhel" when /amazon/ "amazon" diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb index 1cd544ca..00f1425c 100644 --- a/spec/unit/plugins/linux/platform_spec.rb +++ b/spec/unit/plugins/linux/platform_spec.rb @@ -429,6 +429,14 @@ OS_RELEASE expect(@plugin[:platform_version].to_i).to eq(13) end + it "should read the platform as clearos and version as 7.3" do + expect(File).to receive(:read).with("/etc/redhat-release").and_return("ClearOS release 7.3.0 (Final)") + @plugin.run + expect(@plugin[:platform]).to eq("clearos") + expect(@plugin[:platform_family]).to eq("rhel") + expect(@plugin[:platform_version].to_f).to eq(7.3) + end + # https://github.com/chef/ohai/issues/560 # Issue is seen on EL7, so that's what we're testing. context "on versions that have /etc/os-release" do |