]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Don't apply HP disk rules to disks not on HP controllers
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index 536377de4d136fa1407d84971f17e39b26f6007e..b6064b38465184f3930eba4189661e2c9c928f20 100644 (file)
@@ -403,9 +403,11 @@ Ohai.plugin(:Hardware) do
     end
 
     devices[:disks].each do |disk|
     end
 
     devices[:disks].each do |disk|
-      if location = disks.find_index(disk[:location])
-        disk[:smart_device] = "cciss,#{location}"
-      end
+      controller = disk[:controller]
+
+      next unless devices[:controllers][controller][:type] == "hp"
+
+      disk[:smart_device] = "cciss,#{disks.find_index(disk[:location])}"
 
       if disk[:status] == "Failed"
         disk[:status] = "failed"
 
       if disk[:status] == "Failed"
         disk[:status] = "failed"