Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
add exception handling for wrong cache file attrbiute
Browse files Browse the repository at this point in the history
  • Loading branch information
gairadzi committed Jul 29, 2015
1 parent e37c1d7 commit b162a87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/chef_handler_foreman/foreman_facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def verify_checksum(attributes)
end
end
File.open(@cache_file, 'w') { |f| f.write(attrs_checksum) }
rescue => e
@cache_expired = true
Chef::Log.info "unable to verify cache checksum - #{e.message}, facts will be sent"
Chef::Log.debug e.backtrace.join("\n")
end
end
end

0 comments on commit b162a87

Please sign in to comment.