summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShahul Hameed <skhajamohid1@bloomberg.net>2015-08-31 16:57:16 -0400
committerShahul Hameed <skhajamohid1@bloomberg.net>2015-08-31 16:59:51 -0400
commit827b4d71bca2b054de5cdce8cc071f076e781e62 (patch)
tree92f0ae032460e897bbdfb8292812c045fca436aa
parentfa3e1a898d6a30685c613d2200d4da115223e96d (diff)
downloadohai-827b4d71bca2b054de5cdce8cc071f076e781e62.tar.gz
Get stepping from description if stepping is nil
-rw-r--r--lib/ohai/plugins/windows/cpu.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ohai/plugins/windows/cpu.rb b/lib/ohai/plugins/windows/cpu.rb
index 1cd7d7a1..d4be9269 100644
--- a/lib/ohai/plugins/windows/cpu.rb
+++ b/lib/ohai/plugins/windows/cpu.rb
@@ -54,7 +54,9 @@ Ohai.plugin(:CPU) do
cpu[current_cpu]["vendor_id"] = processor['manufacturer']
cpu[current_cpu]["family"] = processor['family'].to_s
cpu[current_cpu]["model"] = processor['revision'].to_s
- cpu[current_cpu]["stepping"] = processor['stepping']
+ cpu[current_cpu]["stepping"] = processor['stepping'].nil? \
+ ? processor['description'].match(/Stepping\s+(\d+)/)[1] \
+ : processor['stepping']
cpu[current_cpu]["physical_id"] = processor['deviceid']
cpu[current_cpu]["model_name"] = processor['description']
cpu[current_cpu]["mhz"] = processor['maxclockspeed'].to_s