projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfa47bd
)
Cope when no disk information has been gathered yet
author
Tom Hughes
<tom@compton.nu>
Fri, 8 Jan 2016 21:41:52 +0000
(21:41 +0000)
committer
Tom Hughes
<tom@compton.nu>
Fri, 8 Jan 2016 21:43:00 +0000
(21:43 +0000)
cookbooks/hardware/recipes/default.rb
patch
|
blob
|
history
diff --git
a/cookbooks/hardware/recipes/default.rb
b/cookbooks/hardware/recipes/default.rb
index d929bbf5746f3ae6927bcd05529bb7ded68175b4..867f3a8aa55d43eb3ff23e28768e68b4f0b72b4c 100644
(file)
--- a/
cookbooks/hardware/recipes/default.rb
+++ b/
cookbooks/hardware/recipes/default.rb
@@
-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]