summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-26 15:53:30 -0800
committerTim Smith <tsmith@chef.io>2018-11-26 15:53:30 -0800
commit616c2f7d0220f58dcd89265728ffc3598ff850c8 (patch)
treeaab555dc7bf0b71cf3dbb6b407e490bcff8ab6ef
parent1153542771a5c2ab7bc30a414693b326220389f1 (diff)
downloadohai-616c2f7d0220f58dcd89265728ffc3598ff850c8.tar.gz
Remap nexus -> nexus_centos to match our previous name
This is wrong, but it's what we've been doing for a while Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/linux/platform.rb2
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb4
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 0d487a27..a36cdc8c 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -297,6 +297,8 @@ Ohai.plugin(:Platform) do
"xenserver"
when "cumulus-linux"
"cumulus"
+ when "nexus"
+ "nexus_centos"
else
id
end
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index 74aec866..98b87433 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -109,6 +109,10 @@ describe Ohai::System, "Linux plugin platform" do
expect(plugin.platform_id_remap("cumulus-linux")).to eq("cumulus")
end
+ it "returns nexus_centos for nexus os-release id" do
+ expect(plugin.platform_id_remap("nexus")).to eq("nexus_centos")
+ end
+
it "does not transformation for any other platform" do
expect(plugin.platform_id_remap("ubuntu")).to eq("ubuntu")
end