diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-04-30 12:16:39 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-05-01 11:09:49 -0700 |
commit | 92824ed4962d4dfa713a31e2395210781c167b86 (patch) | |
tree | d59b34f4819109ade8d523cf4b69cf105a205d17 /lib/chef/provider/file.rb | |
parent | a5f5748653d0ffd90292be2aabfea7783be12f2b (diff) | |
download | chef-92824ed4962d4dfa713a31e2395210781c167b86.tar.gz |
create Chef::Resource#state_for_resource_reporter
Use this to override the state reported by the resource reporter
while avoiding the collision over Chef::Resource#state being used
by some LWRPs.
Diffstat (limited to 'lib/chef/provider/file.rb')
-rw-r--r-- | lib/chef/provider/file.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index 44ee91a079..fda8ad2e5e 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -386,8 +386,12 @@ class Chef def update_file_contents do_backup unless needs_creating? - deployment_strategy.deploy(tempfile.path, ::File.realpath(@new_resource.path)) - Chef::Log.info("#{@new_resource} updated file contents #{@new_resource.path}") + deployment_strategy.deploy(tempfile.path, ::File.realpath(new_resource.path)) + Chef::Log.info("#{new_resource} updated file contents #{new_resource.path}") + if managing_content? + # save final checksum for reporting. + new_resource.final_checksum = checksum(new_resource.path) + end end def do_contents_changes |