opscode/chef — pull request #676 by ChrisLundquist (2013-03-12 21:03:49+00:00)
Title: [CHEF-40002] [chef-apply-templates] let templates with absolute paths work

Using master branch:
```
$ sudo chef-apply -e 'template "/tmp/foo" do source "/tmp/bar.erb" end'
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* template[/tmp/foo] action create
================================================================================
Error executing action `create` on resource 'template[/tmp/foo]'
================================================================================

NoMethodError
-------------
undefined method `preferred_filename_on_disk_location' for nil:NilClass

Resource Declaration:
---------------------
# In /tmp/recipe-temporary-file20130312-42913-tdeswc

1: template "/tmp/foo" do source "/tmp/bar.erb" end

Compiled Resource:
------------------
# Declared in /tmp/recipe-temporary-file20130312-42913-tdeswc:1:in `run_chef_recipe'

template("/tmp/foo") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
path "/tmp/foo"
backup 5
source "/tmp/bar.erb"
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end

[2013-03-12T13:58:57-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-03-12T13:58:57-07:00] FATAL: NoMethodError: template[/tmp/foo] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: NoMethodError: undefined method `preferred_filename_on_disk_location' for nil:NilClass
```

Using this branch:

```
$ sudo chef-apply -e 'template "/tmp/foo" do source "/tmp/bar.erb" end'
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* template[/tmp/foo] action create
- create template[/tmp/foo]
--- /tmp/chef-tempfile20130312-43166-hfoaov	2013-03-12 14:02:46.000000000 -0700
+++ /tmp/chef-rendered-template20130312-43166-73qam5	2013-03-12 14:02:46.000000000 -0700
@@ -0,0 +1,3 @@
+mjolnir.hsd1.wa.comcast.net
+Hello World from ERB
+Hello from text
```

bar.erb
```
<%= node.fqdn %>
<%= "Hello World from ERB" %>
Hello from text
```