From 92824ed4962d4dfa713a31e2395210781c167b86 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Thu, 30 Apr 2015 12:16:39 -0700 Subject: 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. --- lib/chef/provider/file.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/chef/provider/file.rb') 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 -- cgit v1.2.1