Improve device detection for P410i disk controllers
authorTom Hughes <tom@compton.nu>
Sun, 2 Sep 2018 22:07:59 +0000 (23:07 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 2 Sep 2018 22:07:59 +0000 (23:07 +0100)
cookbooks/hardware/templates/default/ohai.rb.erb

index 23965c8bd601fd4f1071acd711ebee4a715d3d63..7757dca80d0f70f9132d02a00048eab2462a385e 100644 (file)
@@ -359,7 +359,7 @@ 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
+      elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:*/scsi_generic/sg*").first
         controller[:device] = "/dev/#{File.basename(device)}"
       end
     end