]> git.openstreetmap.org Git - chef.git/commitdiff
Avoid exception for disks with no model
authorTom Hughes <tom@compton.nu>
Tue, 7 Jun 2016 15:10:46 +0000 (16:10 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 7 Jun 2016 15:14:12 +0000 (16:14 +0100)
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