]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Avoid exceptions on machines with bonded interfaces
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index 8192d34c48bfee88b22d354cca6b39327f60cfb1..132d5bcacdb015bb697a958a35958363d7562cf0 100644 (file)
@@ -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)