]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Avoid exception for disks with no model
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index e83343a8ed8198611b84513c36d57fdea7437a39..8192d34c48bfee88b22d354cca6b39327f60cfb1 100644 (file)
@@ -180,7 +180,7 @@ Ohai.plugin(:Hardware) do
         end
       end
 
-      disk[:model].sub!(/-.*$/, "")
+      disk[:model].sub!(/-.*$/, "") if disk[:model]
     end
 
     disk