Improve identification of HP controller device nodes
authorTom Hughes <tom@compton.nu>
Tue, 22 Dec 2015 22:53:52 +0000 (22:53 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 22 Dec 2015 22:53:52 +0000 (22:53 +0000)
cookbooks/hardware/templates/default/ohai.rb.erb

index bb2ab82..6d5e49f 100644 (file)
@@ -356,7 +356,7 @@ Ohai.plugin(:Hardware) do
     controllers.each do |controller|
       if device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/cciss*").first
         controller[:device] = File.basename(device).sub(/^cciss(\d+)$/, "/dev/cciss/c\\1d0")
-      elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target0:0:0/0:0:0:0/scsi_generic/sg*").first
+      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)}"
       end
     end