From 7597a132a268c2d7d1ff02a2e5c5a88d46895454 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 22 Dec 2022 20:22:09 +0000 Subject: [PATCH] Don't apply HP disk rules to disks not on HP controllers --- cookbooks/hardware/templates/default/ohai.rb.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 536377de4..b6064b384 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -403,9 +403,11 @@ Ohai.plugin(:Hardware) do 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" -- 2.39.5