diff options
author | Andrea Campi <andrea.campi@zephirworks.com> | 2012-11-18 22:43:55 +0100 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2012-12-14 11:10:28 -0800 |
commit | 5509897b9f0a536f6b3768f28f569d450ff53232 (patch) | |
tree | bffca25f527cb77c67c367c3146f031e87d25ef6 /lib/chef/provider/template.rb | |
parent | d4b4bd7b658d36d1363879e269963bbbe8089663 (diff) | |
download | chef-5509897b9f0a536f6b3768f28f569d450ff53232.tar.gz |
[CHEF-3249] Basic implementation of partials in templates.
Diffstat (limited to 'lib/chef/provider/template.rb')
-rw-r--r-- | lib/chef/provider/template.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/provider/template.rb b/lib/chef/provider/template.rb index c937b9d980..cce3418f91 100644 --- a/lib/chef/provider/template.rb +++ b/lib/chef/provider/template.rb @@ -109,6 +109,10 @@ class Chef context = {} context.merge!(@new_resource.variables) context[:node] = node + context[:partial_resolver] = lambda do + cookbook = _run_context.cookbook_collection[resource_cookbook] + partial_location = cookbook.preferred_filename_on_disk_location(node, :templates, partial_name) + end render_template(IO.read(template_location), context, &block) end |