summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Nordsieck <theo@opscode.com>2013-09-09 20:20:06 -0700
committerTheodore Nordsieck <theo@opscode.com>2013-09-11 16:13:24 -0700
commit5e704bc63308c6c40183ddefdff1a9c805118ed7 (patch)
treec0bbf3f92751d8f04d9dfd13ad7812c5cb71449f
parentbef09bea84be795d537b2371d0424d45cb425970 (diff)
downloadohai-5e704bc63308c6c40183ddefdff1a9c805118ed7.tar.gz
Converted plugins/openbsd/cpu to Mixlib::ShellOut.
-rw-r--r--lib/ohai/plugins/openbsd/cpu.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ohai/plugins/openbsd/cpu.rb b/lib/ohai/plugins/openbsd/cpu.rb
index 428a1143..ed69db61 100644
--- a/lib/ohai/plugins/openbsd/cpu.rb
+++ b/lib/ohai/plugins/openbsd/cpu.rb
@@ -33,9 +33,10 @@ Ohai.plugin do
end
end
- cpuinfo[:model_name] = from("sysctl -n hw.model")
- cpuinfo[:total] = from("sysctl -n hw.ncpu")
- cpuinfo[:mhz] = from("sysctl -n hw.cpuspeed")
+ [["hw.model", :model_name], ["hw.ncpu", :total], ["hw.cpuspeed", :mhz]].each do |param, node|
+ so = shell_out("sysctl -n #{param}")
+ cpuinfo[node] = so.stdout.split($/)[0]
+ end
cpu cpuinfo
end