Issue #21198 has been updated by Andrew Parker.

Status changed from Accepted to In Topic Branch Pending Review
Assignee deleted (Andrew Parker)
Branch set to https://github.com/puppetlabs/puppet/pull/1913

<https://github.com/puppetlabs/puppet/pull/1913>

----------------------------------------
Bug #21198: hiera calling_module / calling_class not set for automatic 
parameter lookups
https://projects.puppetlabs.com/issues/21198#change-97675

* Author: Robert Frank
* Status: In Topic Branch Pending Review
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 3.4.0
* Affected Puppet version: 3.0.0
* Keywords: 
* Branch: https://github.com/puppetlabs/puppet/pull/1913
----------------------------------------
The automatic parameter lookup uses a different scope (Puppet::DataBinding) 
than the explicit lookup with the hiera function (Hiera::Scope). The 
calling_module and calling_class variables are generated in Hiera::Scope and 
therefore are not available when automatic parameter lookup is used. This 
breaks hiera configurations that make use of those variables for lookups.
Including the following class in a node definition on a puppet master
<pre>
class test($myopt = 'default') {
  notify { "auto myopt: ${myopt}": }
  $myvar = hiera('test::myopt', $myopt)
  notify { "hiera myopt: ${myvar}": }
}
</pre>
with a hiera configuration that uses
<pre>
- %{calling_module}
- common
</pre>
and different configuration values for test::myopt in test.yaml and common.yaml 
prints the value defined in test.yaml for the explicit lookup and the value 
defined in common.yaml for the automatic lookup.



-- 
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 [email protected].
To post to this group, send email to [email protected].
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