Issue #21370 has been updated by Charlie Sharpsteen.

Category set to templates
Status changed from Unreviewed to Ready for Documentation
Assignee set to Charlie Sharpsteen
Keywords changed from template, special keywords to wrapper_methods

What you are seeing is the effect of #19058. In 3.x, Puppet variables 
referenced inside templates need to be prefixed with an @ symbol. Without this 
prefix, you are getting the return value of the `file` method [which is part of 
our 
TemplateWrapper](https://github.com/puppetlabs/puppet/blob/3.2.2/lib/puppet/parser/templatewrapper.rb#L16-L20).
 Prior to #19058, this method was being masked by Puppet variables.

In summary: the behavior of the variable is expected and part of the template 
documentation. However, the template documentation does need to be updated to 
cover the existence of methods like `file` that are provided by the 
TemplateWrapper so their existence can be discovered without browsing the code.

----------------------------------------
Bug #21370: Variable evalution in template changed from Puppet 3.0.2 to Puppet 
3.2.1
https://projects.puppetlabs.com/issues/21370#change-93208

* Author: Jens Bräuer
* Status: Ready for Documentation
* Priority: Normal
* Assignee: Charlie Sharpsteen
* Category: templates
* Target version: 
* Affected Puppet version: 3.2.1
* Keywords: wrapper_methods
* Branch: 
----------------------------------------
I used the parameter name "$file" in one define. Within the define, a template 
is rendered via file/content. Within the the template, I access the named 
parameter via "<%= file %>".

Using Puppet 2.7.x and Puppet 3.0.2, this worked as expected. However with the 
upgrade to Puppet version 3.2.1 "file" now evaluates to the path of the 
template.

Please find a minimal example here: 
https://github.com/jbraeuer/finna-be-wallhack/

Using Puppet 3.0.2 the file has the content "File is bar".
Using Puppet 3.2.1 the file has the content "File is 
/home/jbraeuer/finna-be-wallhack/filebug/templates/example.erb"

In both cases Puppet is run using ruby 1.9.3p194 (2012-04-20 revision 35410) 
[x86_64-linux] on Ubuntu 12.04.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to