]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Cope when no disk information has been gathered yet
[chef.git] / cookbooks / hardware / recipes / default.rb
index d929bbf5746f3ae6927bcd05529bb7ded68175b4..867f3a8aa55d43eb3ff23e28768e68b4f0b72b4c 100644 (file)
@@ -297,7 +297,13 @@ end
   end
 end
 
-disks = node[:hardware][:disk][:disks].map do |disk|
+if node[:hardware][:disk]
+  disks = node[:hardware][:disk][:disks]
+else
+  disks = []
+end
+
+disks = disks.map do |disk|
   next if disk[:state] == "spun_down"
 
   if disk[:smart_device]