summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-01-24 10:18:23 -0800
committerGitHub <noreply@github.com>2017-01-24 10:18:23 -0800
commit64a496c5390dd35a37df6ecc89c1bd746cbf27c8 (patch)
tree8c7e3ea8e383fc6749224da300dc3f152e8a918e
parentd13bb0d38532328058b00c0d95a8ad45999093da (diff)
parentf911d95c3b7fb9cf6c347703dcfc88465041b0af (diff)
downloadohai-64a496c5390dd35a37df6ecc89c1bd746cbf27c8.tar.gz
Merge pull request #918 from chef/COOL-626/tduffield/use-cpu-name-for-model-name-windows
Use name for Windows CPU model_name
-rw-r--r--lib/ohai/plugins/windows/cpu.rb3
-rw-r--r--spec/unit/plugins/windows/cpu_spec.rb9
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/ohai/plugins/windows/cpu.rb b/lib/ohai/plugins/windows/cpu.rb
index ccb29c86..e8ad9138 100644
--- a/lib/ohai/plugins/windows/cpu.rb
+++ b/lib/ohai/plugins/windows/cpu.rb
@@ -60,7 +60,8 @@ Ohai.plugin(:CPU) do
processor["stepping"]
end
cpu[current_cpu]["physical_id"] = processor["deviceid"]
- cpu[current_cpu]["model_name"] = processor["description"]
+ cpu[current_cpu]["model_name"] = processor["name"]
+ cpu[current_cpu]["description"] = processor["description"]
cpu[current_cpu]["mhz"] = processor["maxclockspeed"].to_s
cpu[current_cpu]["cache_size"] = "#{processor['l2cachesize']} KB"
end
diff --git a/spec/unit/plugins/windows/cpu_spec.rb b/spec/unit/plugins/windows/cpu_spec.rb
index 313104bf..b4393e82 100644
--- a/spec/unit/plugins/windows/cpu_spec.rb
+++ b/spec/unit/plugins/windows/cpu_spec.rb
@@ -32,8 +32,13 @@ shared_examples "a cpu" do |cpu_no|
expect(@plugin[:cpu]["#{cpu_no}"][:vendor_id]).to eq("GenuineIntel")
end
- it "should set model_name to Intel64 Family 6 Model 70 Stepping 1" do
+ it "should set model_name to Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz" do
expect(@plugin[:cpu]["#{cpu_no}"][:model_name])
+ .to eq("Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz")
+ end
+
+ it "should set description to Intel64 Family 6 Model 70 Stepping 1" do
+ expect(@plugin[:cpu]["#{cpu_no}"][:description])
.to eq("Intel64 Family 6 Model 70 Stepping 1")
end
@@ -64,6 +69,7 @@ describe Ohai::System, "Windows cpu plugin" do
@double_wmi_instance = instance_double(WmiLite::Wmi)
@processors = [{ "description" => "Intel64 Family 6 Model 70 Stepping 1",
+ "name" => "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz",
"deviceid" => "CPU0",
"family" => 2,
"manufacturer" => "GenuineIntel",
@@ -75,6 +81,7 @@ describe Ohai::System, "Windows cpu plugin" do
"l2cachesize" => 64 },
{ "description" => "Intel64 Family 6 Model 70 Stepping 1",
+ "name" => "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz",
"deviceid" => "CPU1",
"family" => 2,
"manufacturer" => "GenuineIntel",