Issue #3773 has been updated by Markus Roberts.

Status changed from Unreviewed to Rejected

Timeout is a ruby method and thus can't be used as a variable name; the same is 
true of other methods (print, require, sleep, lambda, etc.) and reserved words 
(def, while, if, class, etc.).

You may be able to access them with @-notation (@timeout) but it's probably 
best to use a non-conflicting name, such as timeout_value, as you have done.

----------------------------------------
Bug #3773: Can't use "timeout" as a variable name in an erb template
http://projects.puppetlabs.com/issues/3773

Author: Robin Bowes
Status: Rejected
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.25.4
Keywords: template erb
Branch: 


I got this error when puppet tried to parse a template:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed 
to parse template pulse/lvs.cf.virtual.erb: wrong number of arguments (0 for 1) 
at /etc/puppet/modules/pulse/manifests/config.pp:121 on node 
a003.private.a.statcounter.com

I debugged the content of the template until I found that a template containing 
this single line caused the same error:

timeout = <%= timeout %>

I worked around this by changing the variable name to timeout_value:

timeout = <%= timeout_value %>


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