X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/8ad66df69a108a031ff4fb869f002a6598005649..83ae724313a707e470a7ea6328cf0c4225cc2121:/cookbooks/hardware/libraries/sensors.rb diff --git a/cookbooks/hardware/libraries/sensors.rb b/cookbooks/hardware/libraries/sensors.rb index 512ba31ff..6508ffb7d 100644 --- a/cookbooks/hardware/libraries/sensors.rb +++ b/cookbooks/hardware/libraries/sensors.rb @@ -4,22 +4,15 @@ class Chef sensors ||= {} results = [] - sensors.sort.each do |sensor,attributes| + sensors.sort.each do |sensor, attributes| if attributes[:ignore] results << "ignore #{sensor}" else - if label = attributes[:label] - resuls << "label #{sensor} \"#{label}\"" - end - - if compute = attributes[:compute] - resuls << "compute #{sensor} #{compute}" - end + results << "label #{sensor} \"#{attributes[:label]}\"" if attributes[:label] + results << "compute #{sensor} #{attributes[:compute]}" if attributes[:compute] attribute_names.each do |name| - if value = attributes[name] - results << "set #{sensor}_#{name} #{value}" - end + results << "set #{sensor}_#{name} #{attributes[name]}" if attributes[name] end end end