]> git.openstreetmap.org Git - chef.git/commitdiff
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 bb2ab824e4285ef2c69f1a55f3c8028cabcabb55..6d5e49fb1314606bbdae987c09b99dec0a3601a3 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