From: Tom Hughes Date: Thu, 22 Dec 2022 19:53:26 +0000 (+0000) Subject: Don't set smart_device for cciss disks which aren't in the PD list X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/a9f84d3b2526857bb3eb067ac94aea53c1954f4d Don't set smart_device for cciss disks which aren't in the PD list --- diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 6e6e5f37e..536377de4 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -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"