Issue #22800 has been updated by David Portabella.

Felix Frank wrote:
> David Portabella wrote:
> > 
> > the deprecated version does not work 100% as intended.
> > in my opinion, to work 100% as intended, the templates should show a 
> > warning against using dynamic lookup (as it is done in puppet manifests).
> 
> Does attempting the use of dynamically scoped variables still lead to 
> warnings? I was under the impression that since 3.0 it just won't work.
i was talking about puppet 2.7:
puppet 2.7 does not work 100% as intended.
in my opinion, for puppet 2.7 to work 100% as intended, the templates should 
show a warning against using dynamic lookup (as it is done in puppet manifests).


> I don't think such a warning can be reliably generated, for the same reason 
> that dynamic scoping did not work predictably (which is why it was finally 
> removed). So I'm fine with the lack of a warning either way.
puppet 2.7 already shows a warning about using dynamic lookup on manifest 
programs (.pp).
it makes sense to have the same behaviour for templates.



----------------------------------------
Bug #22800: dynamic variable lookup works in templates
https://projects.puppetlabs.com/issues/22800#change-100278

* Author: Robert Birnie
* Status: In Topic Branch Pending Review
* Priority: Normal
* Assignee: Damon Atkins
* Category: templates
* Target version: 
* Affected Puppet version: 3.2.2
* Keywords: templates scope
* Branch: https://github.com/puppetlabs/puppet/pull/2117
----------------------------------------
Summary: 

>From within templates, dynamic lookup of variables seems to work. I can 
>declare a variable in the init.pp file. It shows up as undefined in the 
>configuration.pp file. But then it will work fine within the templates created 
>by configuration.pp. 

Steps to Reproduce: 

I've created a github repo with a simple module that shows off the issue. 
Basically its just creating a dynamic lookup variable in a template though, 
nothing special. 
https://github.com/rbirnie/puppet_scope_bug

Expected Results:

The variable should return undef which is what the manifests return.

Actual Results:

The variable returns the value that is assigned.

Notes:
Both agent and master are puppet 3.2.2


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to