summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-06-22 02:36:41 +0100
committerGitHub <noreply@github.com>2019-06-22 02:36:41 +0100
commit6e643b29f0e4b96773d5d81f2ce82664cf8cfe66 (patch)
tree33f5774eb2c3056968c3a8b37991cb459781270e
parent570fb2f076a420cab1e793e6849f80d2ba32722b (diff)
parenta849199c12041028faf93a16d193e4bf1a35ca2e (diff)
downloadohai-6e643b29f0e4b96773d5d81f2ce82664cf8cfe66.tar.gz
Merge pull request #1379 from michel-slm/fix-shard-on-mac
[shard_seed] fix default_sources for linux, darwin and windows
-rw-r--r--lib/ohai/plugins/shard.rb2
-rw-r--r--spec/unit/plugins/shard_spec.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ohai/plugins/shard.rb b/lib/ohai/plugins/shard.rb
index b3c6e932..2909b088 100644
--- a/lib/ohai/plugins/shard.rb
+++ b/lib/ohai/plugins/shard.rb
@@ -30,7 +30,7 @@ Ohai.plugin(:ShardSeed) do
def default_sources
case collect_os
- when :linux, :darwin, :windows
+ when "linux", "darwin", "windows"
[:machinename, :serial, :uuid]
else
[:machinename]
diff --git a/spec/unit/plugins/shard_spec.rb b/spec/unit/plugins/shard_spec.rb
index d8d48fa5..f0ba40b6 100644
--- a/spec/unit/plugins/shard_spec.rb
+++ b/spec/unit/plugins/shard_spec.rb
@@ -27,7 +27,7 @@ describe Ohai::System, "shard plugin" do
let(:machine_id) { "0a1f869f457a4c8080ab19faf80af9cc" }
let(:machinename) { "somehost004" }
let(:fips) { false }
- let(:os) { :linux }
+ let(:os) { "linux" }
subject do
plugin.run
@@ -66,7 +66,7 @@ describe Ohai::System, "shard plugin" do
end
context "with Darwin OS" do
- let(:os) { :darwin }
+ let(:os) { "darwin" }
before do
plugin["hardware"] = { "serial_number" => serial, "platform_UUID" => uuid }
end
@@ -77,7 +77,7 @@ describe Ohai::System, "shard plugin" do
end
context "with Windows OS" do
- let(:os) { :windows }
+ let(:os) { "windows" }
before do
wmi = double("WmiLite::Wmi")
allow(WmiLite::Wmi).to receive(:new).and_return(wmi)
@@ -99,7 +99,7 @@ describe Ohai::System, "shard plugin" do
end
context "with a weird OS" do
- let(:os) { :aix }
+ let(:os) { "aix" }
it "should provide a shard with a default-safe set of sources" do
# Note: this is different than the other defaults.