Issue #10146 has been updated by Jeff McCune.

Target version changed from 2.7.15 to 2.7.20

# Fixed in 2.7.20

According to the announcement:

## Special notes about 2.7.20 ##

Puppet 2.7.20 also addresses concerns regarding a change
introduced in Puppet 2.7.16, "b26699a (#10146) `-` is not legal in
variable names.", which disallowed the use of dashes in variable
names. Puppet 2.7.20 introduces a configuration option,
`allow_variables_with_dashes`,
(http://docs.puppetlabs.com/references/2.7.latest/configuration.html#allowvariableswithdashes)
which can be set to `true` to restore earlier behavior, although this
is strongly discouraged. The option is set to false by default to
maintain current behavior.

     (#10146) `-` in variable names should be deprecated!

     In commit b26699a2 I fixed an accidentally introduced change to the lexer,
     allowing `-` to be part of a variable name.  That had lasted for
a while and
     was surprisingly popular.  It was also hugely ambiguous around
`-` as minus,
     and led to all sorts of failures - unexpected interpolations to nothing -
     because of that.

     A much better strategy would have been to deprecate the feature,
issue proper
     warnings, and include an option to allow users to toggle the behaviour.

     Initially defaulting that to "permit", and eventually toggling
over to "deny",
     would have made the whole experience much smoother - even if this
was totally
     documented as not working, and was a clear bug that it changed.

     So, thanks to prompting from Benjamin Irizarry, we do just that:
introduce the
     configuration option, default it to "deny" to match current behaviour, but
     allow users the choice to change this back.

     Please be aware that allowing variables with `-` might break all sorts of
     things around, for example, Forge modules though.  Most people
write code to
     the documented standard, and their code might well totally fail
to work with
     this changed away from the default!

     Signed-off-by: Daniel Pittman <[email protected]>
----------------------------------------
Bug #10146: Puppet interpolates variables differently in 2.7.x
https://projects.puppetlabs.com/issues/10146#change-77229

Author: Philip Gardner
Status: Closed
Priority: Urgent
Assignee: 
Category: language
Target version: 2.7.20
Affected Puppet version: 2.7.5
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/757


I'm not sure when this changed, but I recently upgraded from 2.6.7 to 2.7.5.

Given: file { "/usr/local/$lsbdistid-$architecture": ensure => directory }

In 2.6.7 the following would generate a directory name called 
"/usr/local/CentOS-x86_64":

However, in 2.7.5, this now creates a directory called "/usr/local/-x86_64"

If you escape the variables, the resource is created correctly, however this 
wasn't clear until I jumped on IRC.


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