]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Make users-agreed a template
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index bec49f967f38ed1151f00819f3ad533e8de65b25..fec5d6bf319ca9fe39277c55954286cf755ca8ec 100644 (file)
@@ -358,6 +358,8 @@ Ohai.plugin(:Hardware) do
         controller[:device] = File.basename(device).sub(/^cciss(\d+)$/, "/dev/cciss/c\\1d0")
       elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:3:0/*:3:0:0/scsi_generic/sg*").first
         controller[:device] = "/dev/#{File.basename(device)}"
+      elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:0/scsi_generic/sg*").first
+        controller[:device] = "/dev/#{File.basename(device)}"
       end
     end
   end
@@ -865,7 +867,6 @@ Ohai.plugin(:Hardware) do
   end
 
   def psu_devices
-    devices = {}
     device = nil
 
     IO.popen(["dmidecode", "-t", "39"]).each_with_object([]) do |line, devices|
@@ -878,8 +879,6 @@ Ohai.plugin(:Hardware) do
         device = nil
       end
     end
-
-    devices
   end
 
   def mc_device