]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Don't set smart_device for cciss disks which aren't in the PD list
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index 6e6e5f37e200d1f86c50ba95882fcdf126553970..536377de4d136fa1407d84971f17e39b26f6007e 100644 (file)
@@ -403,7 +403,9 @@ Ohai.plugin(:Hardware) do
     end
 
     devices[:disks].each do |disk|
-      disk[:smart_device] = "cciss,#{disks.find_index(disk[:location])}"
+      if location = disks.find_index(disk[:location])
+        disk[:smart_device] = "cciss,#{location}"
+      end
 
       if disk[:status] == "Failed"
         disk[:status] = "failed"