summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-26 20:13:50 -0800
committerTim Smith <tsmith@chef.io>2018-11-26 20:13:50 -0800
commit4dc35bb70e4b34e5ddfd7782973630bb5fe78996 (patch)
treec2167902ce61584b66755a3b348dcdf40cc369f2
parent643599c626c2c5d1f3b89950d262a647a0581756 (diff)
downloadohai-4dc35bb70e4b34e5ddfd7782973630bb5fe78996.tar.gz
Move clearlinux logic to os-release
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/linux/platform.rb1
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb31
2 files changed, 1 insertions, 31 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 343238c5..9a71f19a 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -31,6 +31,7 @@ Ohai.plugin(:Platform) do
"xenenterprise" => "xenserver",
"cumulus-linux" => "cumulus",
"nexus" => "nexus_centos",
+ "clear-linux-os" => "clearlinux",
}.freeze
end
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index def4c0d3..8f0bbb9b 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -922,36 +922,5 @@ OS_DATA
expect(plugin[:platform_version]).to eq("6.0.0.14I")
end
end
-
- describe "on clearlinux" do
- let(:have_usr_lib_os_release) { true }
- let(:usr_lib_os_release_content) do
- <<~CLEARLINUX_RELEASE
- NAME="Clear Linux Software for Intel Architecture"
- VERSION=1
- ID=clear-linux-os
- VERSION_ID=16140
- PRETTY_NAME="Clear Linux OS for Intel Architecture"
- ANSI_COLOR="1;35"
- HOME_URL="https://clearlinux.org"
- SUPPORT_URL="https://clearlinux.org"
- BUG_REPORT_URL="mailto:dev@lists.clearlinux.org"
- PRIVACY_POLICY_URL="http://www.intel.com/privacy"
-CLEARLINUX_RELEASE
- end
-
- before do
- expect(File).to receive(:read).with("/usr/lib/os-release").and_return(usr_lib_os_release_content)
- end
-
- it "should set platform to clearlinux and platform_family to clearlinux" do
- plugin.lsb = nil
- plugin.run
-
- expect(plugin[:platform]).to eq("clearlinux")
- expect(plugin[:platform_family]).to eq("clearlinux")
- expect(plugin[:platform_version]).to eq("16140")
- end
- end
end
end