]> git.openstreetmap.org Git - chef.git/commitdiff
Don't set smart_device for cciss disks which aren't in the PD list
authorTom Hughes <tom@compton.nu>
Thu, 22 Dec 2022 19:53:26 +0000 (19:53 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 22 Dec 2022 19:53:57 +0000 (19:53 +0000)
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|
     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"
 
       if disk[:status] == "Failed"
         disk[:status] = "failed"