Steve Snodgrass
2011-Oct-05 17:46 UTC
[Puppet Users] Puppet 2.7 allows dash in variable names: bug or feature?
While testing puppet 2.7, I found that one of my manifests broke
because of the following quoted string:
"http://$yumserver/repos/vmware-$esxversion-rhel6-64"
Everything in the resulting string after "vmware-" was blank. After
some experiments I found that puppet 2.7 allows dashes in variable
names, and was interpreting "$esxversion-rhel6-64" as one big
variable. Of course adding curly braces fixes the problem, but that
seems like a significant change. Was it intended?
Results of applying a simple test manifest:
notice("Dashtest: $fqdn-is-my-hostname")
Puppet 2.6.11:
notice: Scope(Class[main]): Dashtest: foobar.example.com-is-my-
hostname
Puppet 2.7.5:
notice: Scope(Class[main]): Dashtest:
-Steve
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Evgeny
2011-Oct-06 06:19 UTC
[Puppet Users] Re: Puppet 2.7 allows dash in variable names: bug or feature?
perhaps you should enclose the variables in quotes to something like
this:
"http://${yumserver}/repos/vmware-${esxversion-rhel6-64}"
On Oct 5, 8:46 pm, Steve Snodgrass <phe...@gmail.com>
wrote:> While testing puppet 2.7, I found that one of my manifests broke
> because of the following quoted string:
>
> "http://$yumserver/repos/vmware-$esxversion-rhel6-64"
>
> Everything in the resulting string after "vmware-" was blank.
After
> some experiments I found that puppet 2.7 allows dashes in variable
> names, and was interpreting "$esxversion-rhel6-64" as one big
> variable. Of course adding curly braces fixes the problem, but that
> seems like a significant change. Was it intended?
>
> Results of applying a simple test manifest:
>
> notice("Dashtest: $fqdn-is-my-hostname")
>
> Puppet 2.6.11:
>
> notice: Scope(Class[main]): Dashtest: foobar.example.com-is-my-
> hostname
>
> Puppet 2.7.5:
>
> notice: Scope(Class[main]): Dashtest:
>
> -Steve
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Jason Koppe
2011-Oct-22 05:49 UTC
[Puppet Users] Re: Puppet 2.7 allows dash in variable names: bug or feature?
We have interpolations like "$name-tomcat" all over our manifests.
It''s possible to adjust them all to "${name}-tomcat" but
it''s not
going to be fun :)
On Oct 6, 1:19 am, Evgeny <eokole...@gmail.com>
wrote:> perhaps you should enclose the variables in quotes to something like
> this:
>
> "http://${yumserver}/repos/vmware-${esxversion-rhel6-64}"
>
> On Oct 5, 8:46 pm, Steve Snodgrass <phe...@gmail.com> wrote:
>
>
>
>
>
>
>
> > While testingpuppet2.7, I found that one of my manifests broke
> > because of the following quoted string:
>
> > "http://$yumserver/repos/vmware-$esxversion-rhel6-64"
>
> > Everything in the resulting string after "vmware-" was
blank. After
> > some experiments I found thatpuppet2.7allowsdashes invariable
> >names, and was interpreting "$esxversion-rhel6-64" as one big
> >variable. Of course adding curly braces fixes the problem, but that
> > seems like a significant change. Was it intended?
>
> > Results of applying a simple test manifest:
>
> > notice("Dashtest: $fqdn-is-my-hostname")
>
> >Puppet2.6.11:
>
> > notice: Scope(Class[main]): Dashtest: foobar.example.com-is-my-
> > hostname
>
> >Puppet2.7.5:
>
> > notice: Scope(Class[main]): Dashtest:
>
> > -Steve
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Scott Smith
2011-Oct-22 05:52 UTC
Re: [Puppet Users] Re: Puppet 2.7 allows dash in variable names: bug or feature?
Funny, I accidentally avoided problems caused by this change because I always suffix variables when possible. On Fri, Oct 21, 2011 at 10:49 PM, Jason Koppe <jason.robert.koppe@gmail.com>wrote:> We have interpolations like "$name-tomcat" all over our manifests. > It''s possible to adjust them all to "${name}-tomcat" but it''s not > going to be fun :) > > On Oct 6, 1:19 am, Evgeny <eokole...@gmail.com> wrote: > > perhaps you should enclose the variables in quotes to something like > > this: > > > > "http://${yumserver}/repos/vmware-${esxversion-rhel6-64}" > > > > On Oct 5, 8:46 pm, Steve Snodgrass <phe...@gmail.com> wrote: > > > > > > > > > > > > > > > > > While testingpuppet2.7, I found that one of my manifests broke > > > because of the following quoted string: > > > > > "http://$yumserver/repos/vmware-$esxversion-rhel6-64" > > > > > Everything in the resulting string after "vmware-" was blank. After > > > some experiments I found thatpuppet2.7allowsdashes invariable > > >names, and was interpreting "$esxversion-rhel6-64" as one big > > >variable. Of course adding curly braces fixes the problem, but that > > > seems like a significant change. Was it intended? > > > > > Results of applying a simple test manifest: > > > > > notice("Dashtest: $fqdn-is-my-hostname") > > > > >Puppet2.6.11: > > > > > notice: Scope(Class[main]): Dashtest: foobar.example.com-is-my- > > > hostname > > > > >Puppet2.7.5: > > > > > notice: Scope(Class[main]): Dashtest: > > > > > -Steve > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Brice Figureau
2011-Oct-22 16:47 UTC
Re: [Puppet Users] Puppet 2.7 allows dash in variable names: bug or feature?
On 05/10/11 19:46, Steve Snodgrass wrote:> While testing puppet 2.7, I found that one of my manifests broke > because of the following quoted string: > > "http://$yumserver/repos/vmware-$esxversion-rhel6-64" > > Everything in the resulting string after "vmware-" was blank. After > some experiments I found that puppet 2.7 allows dashes in variable > names, and was interpreting "$esxversion-rhel6-64" as one big > variable. Of course adding curly braces fixes the problem, but that > seems like a significant change. Was it intended?I don''t know if it was intended, but there''s a ticket open right now: http://projects.puppetlabs.com/issues/10146 Go watch it to increase the odds of it being fixed :) I really believe ''-'' shouldn''t be allowed at end of any variable name, which then should fix your problem. -- Brice Figureau My Blog: http://www.masterzen.fr/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Brice Figureau
2011-Oct-22 17:04 UTC
Re: [Puppet Users] Puppet 2.7 allows dash in variable names: bug or feature?
On 22/10/11 18:47, Brice Figureau wrote:> On 05/10/11 19:46, Steve Snodgrass wrote: >> While testing puppet 2.7, I found that one of my manifests broke >> because of the following quoted string: >> >> "http://$yumserver/repos/vmware-$esxversion-rhel6-64" >> >> Everything in the resulting string after "vmware-" was blank. After >> some experiments I found that puppet 2.7 allows dashes in variable >> names, and was interpreting "$esxversion-rhel6-64" as one big >> variable. Of course adding curly braces fixes the problem, but that >> seems like a significant change. Was it intended? > > I don''t know if it was intended, but there''s a ticket open right now: > http://projects.puppetlabs.com/issues/10146 > > Go watch it to increase the odds of it being fixed :) > > I really believe ''-'' shouldn''t be allowed at end of any variable name, > which then should fix your problem.Or not, because the lexer would tokenize $esxversion-rhel6 as the variable name... -- Brice Figureau My Blog: http://www.masterzen.fr/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.