X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/4d81711580ed328384d60781d95df39df528a6b3..1f0495ace8de757939fde8a77b8070ab3d5f2681:/cookbooks/hardware/templates/default/ohai.rb.erb diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index e83343a8e..132d5bcac 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -5,12 +5,12 @@ Ohai.plugin(:Hardware) do def read_sysctl_link(file) File.basename(File.readlink(file)) - rescue Errno::ENOENT + rescue Errno::ENOENT, Errno::ENOTDIR end def read_sysctl_file(file) IO.read(file).strip - rescue Errno::ENOENT, Errno::EINVAL + rescue Errno::ENOENT, Errno::ENOTDIR, Errno::EINVAL end def parse_memory_size(size) @@ -180,7 +180,7 @@ Ohai.plugin(:Hardware) do end end - disk[:model].sub!(/-.*$/, "") + disk[:model].sub!(/-.*$/, "") if disk[:model] end disk