]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Rubocop cleanups
[chef.git] / cookbooks / hardware / recipes / default.rb
index a0ee58485bc0406d6c1f79d73d991af3852784e5..dd2d8015727afc1ccc716fb234eace7cbae45065 100644 (file)
@@ -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