Issue #5489 has been reported by Dan Bode.

----------------------------------------
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

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


I ran into the following:

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

{{{
#y.erb
<%= y %>
}}}

I am lucky the function required an argument.

{{{
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
}}}

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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to