From: Tom Hughes Date: Tue, 7 Jun 2016 15:10:46 +0000 (+0100) Subject: Avoid exception for disks with no model X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/4cae3ac4457fe9c0ea9e65de832d66f852483495 Avoid exception for disks with no model --- diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index e83343a8e..8192d34c4 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -180,7 +180,7 @@ Ohai.plugin(:Hardware) do end end - disk[:model].sub!(/-.*$/, "") + disk[:model].sub!(/-.*$/, "") if disk[:model] end disk