Don't monitor unraided disks on mpt2/mpt3 controllers twice
authorTom Hughes <tom@compton.nu>
Mon, 20 Jul 2015 22:07:23 +0000 (23:07 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 20 Jul 2015 22:07:23 +0000 (23:07 +0100)
cookbooks/hardware/recipes/default.rb

index f19446969c2d33c11f0f28b8ed81faa91ae8a5b2..3c2f84a681472fdcf64b34ff85ffd959482e989a 100644 (file)
@@ -332,6 +332,8 @@ if status_packages["sas2ircu-status"]
     bus = host.sub("/sys/class/scsi_host/host", "")
 
     Dir.glob("/sys/bus/scsi/devices/#{bus}:0:*/scsi_generic/*").each do |sg|
     bus = host.sub("/sys/class/scsi_host/host", "")
 
     Dir.glob("/sys/bus/scsi/devices/#{bus}:0:*/scsi_generic/*").each do |sg|
+      next if File.directory?("#{sg}/../../block")
+
       disks << { :device => File.basename(sg) }
     end
   end
       disks << { :device => File.basename(sg) }
     end
   end