From: Grant Slater Date: Tue, 12 Mar 2024 21:15:16 +0000 (+0000) Subject: hardware: do not fail if node[:hardware][:pci] is undefined (tests) X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/4dca09e799a49d61e09a832a8d7bc23f2fc176a4 hardware: do not fail if node[:hardware][:pci] is undefined (tests) --- diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index d77aebacd..4e676f387 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -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")