]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/libraries/sensors.rb
Enable resolved prometheus exporter
[chef.git] / cookbooks / hardware / libraries / sensors.rb
index 0a55eae39342d7cbca4f249e666e5900aa6127f4..6508ffb7d8872b8c0c8069333a268269dca2f7c0 100644 (file)
@@ -8,18 +8,11 @@ class Chef
         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