summaryrefslogtreecommitdiff
path: root/lib/chef/provider/template_finder.rb
diff options
context:
space:
mode:
authorAndrea Campi <andrea.campi@zephirworks.com>2012-11-18 23:38:18 +0100
committerBryan McLellan <btm@opscode.com>2012-12-14 11:10:28 -0800
commitb8cd17a7e9a2f5e9738400b96df478bab093c7e7 (patch)
tree0ef1686aab19958765ef0242088b74eb9675880d /lib/chef/provider/template_finder.rb
parent77dda3749fb48f0ac4ee3693e21ca0b453c0bbd1 (diff)
downloadchef-b8cd17a7e9a2f5e9738400b96df478bab093c7e7.tar.gz
[CHEF-3249] Accept an optional 'source' option to override the actual path to the partial.
This is mostly for uniformity with the template resource.
Diffstat (limited to 'lib/chef/provider/template_finder.rb')
-rw-r--r--lib/chef/provider/template_finder.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/template_finder.rb b/lib/chef/provider/template_finder.rb
index d64839fa62..3c402f6aae 100644
--- a/lib/chef/provider/template_finder.rb
+++ b/lib/chef/provider/template_finder.rb
@@ -28,7 +28,9 @@ class Chef
end
def find(template_name, options = {})
- return template_name if options[:local]
+ if options[:local]
+ return options[:source] ? options[:source] : template_name
+ end
cookbook_name = options[:cookbook] ? options[:cookbook] : @cookbook_name