summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Chambers <ccgithub@chrischambers.net>2015-08-21 14:16:07 -0500
committerChris Chambers <ccgithub@chrischambers.net>2015-08-21 14:16:07 -0500
commit45a25acb60ed7c08f6fcf4d064dec3a8ac288462 (patch)
tree67ffe281bce35105b304e64172a4a9565f63aafe
parenta4bb1a643918c794cc2511ab9e9a39fbe98a9362 (diff)
downloadohai-45a25acb60ed7c08f6fcf4d064dec3a8ac288462.tar.gz
ruby style changes
-rw-r--r--lib/ohai/plugins/solaris2/cpu.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/solaris2/cpu.rb b/lib/ohai/plugins/solaris2/cpu.rb
index 3225949a..ca456689 100644
--- a/lib/ohai/plugins/solaris2/cpu.rb
+++ b/lib/ohai/plugins/solaris2/cpu.rb
@@ -32,7 +32,7 @@ Ohai.plugin(:CPU) do
cpusockets = Array.new
processor_info.each_with_index do |processor, i|
desc,instance,record,keyvalue = processor.split(":")
- cpu[instance] = Mash.new if cpu[instance].nil?
+ cpu[instance] ||= Mash.new
if (currentcpu != instance)
cpu["total"] += 1
currentcpu = instance
@@ -52,7 +52,7 @@ Ohai.plugin(:CPU) do
cpu[instance]["model_name"] = value.sub(/\s+/," ")
when /^state$/
cpu[instance]["state"] = value
- cpu["cpustates"][value] = 0 if cpu["cpustates"][value].nil?
+ cpu["cpustates"][value] ||= 0
cpu["cpustates"][value] += 1
when /core_id/
cpu[instance]["core_id"] = value