[Puppet - Bug #3939] (Unreviewed) ALLCAPS variables arent usable in templates.

23 views
Skip to first unread message

red...@puppetlabs.com

unread,
Jun 3, 2010, 2:37:26 PM6/3/10
to ja...@lovedthanlost.net, peter...@immerda.ch, r...@devco.net, d...@puppetlabs.com, puppe...@googlegroups.com
Issue #3939 has been reported by R.I. Pienaar aka Volcane.

Bug #3939: ALLCAPS variables arent usable in templates.

  • Author: R.I. Pienaar aka Volcane
  • Status: Unreviewed
  • Priority: Normal
  • Assigned to:
  • Category:
  • Target version:
  • Affected version: 0.25.5
  • Keywords:
  • Branch:

Puppet lets you set all caps variables in the manifest that you couldnt use in a template:

$FOO = "bar" 
notice "from puppet: ${FOO}" 
notice inline_template("<%= FOO %>") 

Output is:

notice: Scope(Class[main]): from puppet: bar
Failed to parse inline template: uninitialized constant Puppet::Parser::TemplateWrapper::FOO at /home/rip/test.pp:4 on node nephilim.ml.org

Not sure if you can make the template not handle those as constants, but if not then the language shouldn't let us make all caps variables.


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

red...@puppetlabs.com

unread,
Jun 7, 2010, 2:19:47 PM6/7/10
to peter...@immerda.ch, r...@devco.net, d...@puppetlabs.com, jes...@gmail.com, puppe...@googlegroups.com
Issue #3939 has been updated by James Turnbull.
  • Category set to parser
  • Status changed from Unreviewed to Accepted
  • Assigned to set to Jesse Wolfe
  • Target version set to 0.25.6
  • Author: R.I. Pienaar aka Volcane
  • Status: Accepted
  • Priority: Normal
  • Assigned to: Jesse Wolfe
  • Category: parser
  • Target version: 0.25.6
  • Affected version: 0.25.5
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Nov 16, 2010, 3:04:44 PM11/16/10
to je...@puppetlabs.com, peter...@immerda.ch, puppe...@googlegroups.com, r...@devco.net, d...@puppetlabs.com, Ma...@puppetlabs.com, da...@dasz.at, ja...@puppetlabs.com, jes...@gmail.com
Issue #3939 has been updated by James Turnbull.
  • Target version deleted (0.25.6)
  • Author: R.I. Pienaar
  • Status: Accepted
  • Priority: Normal
  • Assignee: Jesse Wolfe
  • Category: parser
  • Target version:
  • Affected Puppet version: 0.25.5
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Dec 14, 2011, 1:10:40 PM12/14/11
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, krzysztof....@linux.com, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com
Issue #3939 has been updated by Joshua Lifton.
  • Assignee deleted (Jesse Wolfe)

This issue was assigned to a former Puppet Labs employee. Adding back to the pool of unreviewed issues.

  • Author: R.I. Pienaar
  • Status: Accepted
  • Priority: Normal
  • Assignee:
  • Category: parser
  • Target version:
  • Affected Puppet version: 0.25.5
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Jan 20, 2012, 5:53:14 PM1/20/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com
Issue #3939 has been updated by Ben Hughes.
  • Description updated
  • Status changed from Accepted to Unreviewed
  • Author: R.I. Pienaar
  • Status: Unreviewed
  • Priority: Normal
  • Assignee:
  • Category: parser
  • Target version:
  • Affected Puppet version: 0.25.5
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Jan 21, 2012, 11:57:17 AM1/21/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com, ni...@puppetlabs.com
Issue #3939 has been updated by Michael Stahnke.
  • Description updated
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten
  • Affected Puppet version changed from 0.25.5 to 2.7.9

This is absolutely still a bug in 2.7.9.

[root@centos5-64 foo]# cat manifests/init.pp 
class foo {
$FOO = "Hello World"
file { "/tmp/output":
ensure => present,
mode => 0600,
content => template('foo/test.erb'),
}
}
[root@centos5-64 foo]# cat templates/test.erb 
<%= FOO %>
[root@centos5-64 foo]# puppet apply --verbose --modulepath=.. -e 'include foo'
Failed to parse template foo/test.erb: uninitialized constant Puppet::Parser::TemplateWrapper::FOO at /root/module/foo/manifests/init.pp:9 on node centos5-64.localdomain
[root@centos5-64 foo]# 

I’m not sure we should support this. my recommended fix would be to not allow all cap variables in manifests.

  • Author: R.I. Pienaar
  • Status: Needs Decision
  • Priority: Normal
  • Assignee: Nigel Kersten
  • Category: parser
  • Target version:
  • Affected Puppet version: 2.7.9
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Jan 21, 2012, 12:06:37 PM1/21/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com
Issue #3939 has been updated by Michael Stahnke.
  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Nigel Kersten)
  • Target version set to 2.7.x

Ok, so the course of action is to not allow ALLCAPS variables in the Puppet DSL.

  • Author: R.I. Pienaar
  • Status: Accepted
  • Priority: Normal
  • Assignee:
  • Category: parser
  • Target version: 2.7.x
  • Affected Puppet version: 2.7.9
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Jan 21, 2012, 12:10:49 PM1/21/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com
Issue #3939 has been updated by Michael Stahnke.
  • Target version changed from 2.7.x to Telly
  • Author: R.I. Pienaar
  • Status: Accepted
  • Priority: Normal
  • Assignee:
  • Category: parser
  • Target version: Telly
  • Affected Puppet version: 2.7.9
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
Jan 25, 2012, 4:53:55 PM1/25/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com
Issue #3939 has been updated by Daniel Pittman.
  • Status changed from Accepted to Closed

Michael Stahnke wrote:

Ok, so the course of action is to not allow ALLCAPS variables in the Puppet DSL.

Actually, I think they should be available in the new style in templates:

⚡ puppet apply -e '$FOO = "bar" notice(inline_template("[<%= @FOO %>]"))'

The member variable style avoids the collision with Ruby constants.

  • Author: R.I. Pienaar
  • Status: Closed
  • Priority: Normal
  • Assignee:
  • Category: parser
  • Target version: Telly
  • Affected Puppet version: 2.7.9
  • Keywords:
  • Branch:

tic...@puppetlabs.com

unread,
May 9, 2012, 3:03:35 PM5/9/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, k...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com
Issue #3939 has been updated by Daniel Pittman.
  • Target version changed from 3.X to 3.0.0
  • Author: R.I. Pienaar
  • Status: Closed
  • Priority: Normal
  • Assignee:
  • Category: parser
  • Target version: 3.0.0
  • Affected Puppet version: 2.7.9
  • Keywords:
  • Branch:
Reply all
Reply to author
Forward
0 new messages