On Tue, Apr 17, 2012 at 9:00 AM, Andrew Parker <a...@puppetlabs.com> wrote: > > On Apr 16, 2012, at 11:00 PM, Ken Barber wrote: > > Sounds like a great change Andy. I'd be wary about version - I can't think > of one now bit there might be a case where people ref top scope, but now > they get node scope which may be surprising and may break code perhaps? > > Exactly, which is why I was uncertain about what the target version should > be. Since Telly is going to be dropping dynamic scope, we are setting up the > expectation that your variable lookups are going to be different and so > adding in another change doesn't seem as big of a deal. > > Has anyone seen something where a manifest used $::var in order to *not* get > the value of $var that is overridden in a node?
The most common use that comes to mind is facter values. > On Apr 16, 2012 10:20 PM, "Andrew Parker" <a...@puppetlabs.com> wrote: >> >> As I hope everyone is aware, we are planning on removing dynamic scoping >> in Telly (http://docs.puppetlabs.com/guides/scope_and_puppet.html). We know >> that the deprecation warnings that puppet 2.7 has been issuing have been >> wrong, but, hurray!, there is a fix going in for that! However, there is >> still an issue related to dropping dynamic scoping. >> >> At the moment (and under the new regime) >> >> $var = "top scope" >> node default { >> $var = "node" >> include foo >> } >> class foo { >> notify { "which is it?": message => $var } >> } >> >> $var is going to evaluate to "node". If you change that to $::var, then >> you'll end up with "top scope". This doesn't seem right and so we are >> thinking of changing it so that variables declared in a node actually put >> their variables in the top-scope (and override any variable that is already >> there) so that $var and $::var in this situation, and others like it, will >> refer to the same value. Without this change, there is no way to explicitly >> reference variables defined in a node. >> >> Now, if everyone is on board with this change, which you may not all be, >> the next question is which version of puppet should this go into. I lean >> toward making the change in Telly so that we get all of the breaking changes >> to scoping out of the way at once (I hope). Another thought is that this >> should go into 2.7, since it is kinda a bug that $::var and $var are not the >> same thing in this case. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Developers" group. >> To post to this group, send email to puppet-dev@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-dev+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-dev?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to puppet-dev@googlegroups.com. > To unsubscribe from this group, send email to > puppet-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to puppet-dev@googlegroups.com. > To unsubscribe from this group, send email to > puppet-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.