X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/21958591555b0b80370e944e3128ac5d533c281d..d8a2dee0506af930639313dbe0f85817141a650b:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index a0ee58485..dd2d80157 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -204,13 +204,13 @@ node[:kernel][:modules].each_key do |modname| end node[:block_device].each do |name, attributes| - if attributes[:vendor] == "HP" && attributes[:model] == "LOGICAL VOLUME" - if name =~ /^cciss!(c[0-9]+)d[0-9]+$/ - status_packages["cciss-vol-status"] |= ["cciss/#{Regexp.last_match[1]}d0"] - else - Dir.glob("/sys/block/#{name}/device/scsi_generic/*").each do |sg| - status_packages["cciss-vol-status"] |= [File.basename(sg)] - end + next unless attributes[:vendor] == "HP" && attributes[:model] == "LOGICAL VOLUME" + + if name =~ /^cciss!(c[0-9]+)d[0-9]+$/ + status_packages["cciss-vol-status"] |= ["cciss/#{Regexp.last_match[1]}d0"] + else + Dir.glob("/sys/block/#{name}/device/scsi_generic/*").each do |sg| + status_packages["cciss-vol-status"] |= [File.basename(sg)] end end end