Fix collection of PSU details from dmidecode
authorTom Hughes <tom@compton.nu>
Tue, 26 Apr 2016 17:57:56 +0000 (18:57 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 26 Apr 2016 17:57:56 +0000 (18:57 +0100)
cookbooks/hardware/templates/default/ohai.rb.erb

index 1e7ca8713154bc88884ee8a3ca4e0d96b414a50a..bec49f967f38ed1151f00819f3ad533e8de65b25 100644 (file)
@@ -865,6 +865,7 @@ Ohai.plugin(:Hardware) do
   end
 
   def psu_devices
+    devices = {}
     device = nil
 
     IO.popen(["dmidecode", "-t", "39"]).each_with_object([]) do |line, devices|
@@ -877,6 +878,8 @@ Ohai.plugin(:Hardware) do
         device = nil
       end
     end
+
+    devices
   end
 
   def mc_device