def action_create
if file_cache_location && content_stale?
description = []
description << "create a new cookbook_file #{@new_resource.path}"
description << diff_current(file_cache_location)
converge_by(description) do
Chef::Log.debug("#{@new_resource} has new contents")
backup_new_resource
deploy_tempfile do |tempfile|
Chef::Log.debug("#{@new_resource} staging #{file_cache_location} to #{tempfile.path}")
tempfile.close
FileUtils.cp(file_cache_location, tempfile.path)
enforce_tempfile_inheritance(tempfile.path)
end
Chef::Log.info("#{@new_resource} created file #{@new_resource.path}")
end
else
set_all_access_controls
end
end