From: Tom Hughes Date: Tue, 7 Jun 2016 15:13:57 +0000 (+0100) Subject: Avoid exceptions on machines with bonded interfaces X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/7ae6e279d071fb3facc32dbc5e1154aee20ca35b Avoid exceptions on machines with bonded interfaces --- diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 8192d34c4..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)