Ask Your Question
0

Parameter inheritance

asked 2015-07-29 15:27:35 -0500

moosamus gravatar image

I'm getting different behavior between OSX (10.9.5) and Linux (Ubuntu 12.04) using Puppet 3.8.1 with respect to parameter inheritance. I'm using the params class approach, which looks something like this:

class my_class (
$M_LOCATION = $my_class::params::M_LOCATION,
) inherits my_class::params::$M_LOCATION {

do stuff ...

I use this all the time on various Linux distros to set defaults that can be overridden in our ENC without issue. The Linux puppet parser validation returns normally, but puppet parser validation on OSX throws the following error:

Error: Illegal variable name, The given name 'myclass::params::MLOCATION' does not conform to the naming rule /^((::)?[a-z]w)((::)?[a-z_]w*)$/

Pardon my regex, but that seems like it should be ok. Any known differences between the implementations?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-29 22:33:16 -0500

csharpsteen gravatar image

The Puppet 4 Language no longer allows variable names that begin with a capital letter. If you are using the parser=future option in 3.8.1, then this restriction will be in effect:

http://docs.puppetlabs.com/puppet/3.8...

edit flag offensive delete link more
0

answered 2015-07-29 16:17:12 -0500

moosamus gravatar image

So, looks like the parser started enforcing that variables can't start with caps. The OSX parser happens to fail compilation while Linux just warns. Changed it to lower-case and it acts normally.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-29 15:27:35 -0500

Seen: 87 times

Last updated: Jul 29 '15