]> git.openstreetmap.org Git - chef.git/commitdiff
hardware: do not fail if node[:hardware][:pci] is undefined (tests)
authorGrant Slater <github@firefishy.com>
Tue, 12 Mar 2024 21:15:16 +0000 (21:15 +0000)
committerGrant Slater <github@firefishy.com>
Tue, 12 Mar 2024 21:15:16 +0000 (21:15 +0000)
cookbooks/hardware/recipes/default.rb

index d77aebacd248cf0710dca8b780fa99dbf431309c..4e676f3879712720e3ac7211c2e47ae6dd187b59 100644 (file)
@@ -227,7 +227,7 @@ else
 end
 
 watchdog_module = %w[hpwdt sp5100_tco].find do |module_name|
-  node[:hardware][:pci].any? { |_, pci| pci[:modules]&.any?(module_name) }
+  node[:hardware][:pci]&.any? { |_, pci| pci[:modules]&.any?(module_name) }
 end
 
 if node[:kernel][:modules].include?("ipmi_si")