Issue #5489 has been updated by Andrew Parker.

Status changed from Accepted to Duplicate
Affected Puppet version deleted (3.0.0rc3)

This is a duplicate of #3773
----------------------------------------
Bug #5489: template function should warn if any variables from the current 
scope are the same as any methods
https://projects.puppetlabs.com/issues/5489#change-82548

Author: Dan Bode
Status: Duplicate
Priority: Normal
Assignee: 
Category: functions
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


I ran into the following:

<pre>
#y.pp
$y='x'
notice($y)
file { '/tmp/foo':
  content => template('/etc/puppet/templates/y.erb'),
}
</pre>

<pre>
#y.erb
<%= y %>
</pre>

I am lucky the function required an argument.

<pre>
puppet apply y.pp
notice: Scope(Class[main]): x
Failed to parse template /etc/puppet/templates/y.erb: wrong number of arguments 
(0 for 1) at /etc/puppet/manifests/y.pp:4 on node mypuppetmaster.localdomain
</pre>

This was still difficult to debug. In the case of a no argument function, it 
would have been even more difficult to figure out.

for extra credit, what does the y function in puppet do anyways?


-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to