Module: Chef::Deprecation::Provider::Template

Includes:
Mixin::Template
Included in:
Provider::Template
Defined in:
lib/chef/deprecation/provider/template.rb

Overview

Deprecation::Provider::Template

This module contains the deprecated functions of Chef::Provider::Template. These functions are refactored to different components. They are frozen and will be removed in Chef 13.

Instance Method Summary collapse

Methods included from Mixin::Template

#render_template

Instance Method Details

#content_matches?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/chef/deprecation/provider/template.rb', line 56

def content_matches?
  @current_resource.checksum == @new_resource.checksum
end

#rendered(rendered_template) ⇒ Object



50
51
52
53
54
# File 'lib/chef/deprecation/provider/template.rb', line 50

def rendered(rendered_template)
  @new_resource.checksum(checksum(rendered_template.path))
  Chef::Log.debug("Current content's checksum:  #{@current_resource.checksum}")
  Chef::Log.debug("Rendered content's checksum: #{@new_resource.checksum}")
end

#resource_cookbookObject



46
47
48
# File 'lib/chef/deprecation/provider/template.rb', line 46

def resource_cookbook
  @new_resource.cookbook || @new_resource.cookbook_name
end

#template_finderObject



34
35
36
37
38
# File 'lib/chef/deprecation/provider/template.rb', line 34

def template_finder
  @template_finder ||= begin
    Chef::Provider::TemplateFinder.new(run_context, cookbook_name, node)
  end
end

#template_locationObject



40
41
42
43
44
# File 'lib/chef/deprecation/provider/template.rb', line 40

def template_location
  @template_file_cache_location ||= begin
    template_finder.find(@new_resource.source, :local => @new_resource.local, :cookbook => @new_resource.cookbook)
  end
end