Issue #16730 has been updated by konrad rzentarzewski.

Affected Puppet version changed from 3.0.0 to 3.0.1

also affects 3.0.1
----------------------------------------
Bug #16730: Hiera ignores calling_module and calling_class pseudo variables
https://projects.puppetlabs.com/issues/16730#change-75016

Author: Avishai Ish-Shalom
Status: In Topic Branch Pending Review
Priority: Urgent
Assignee: 
Category: 
Target version: 
Affected Puppet version: 3.0.1
Keywords: hiera
Branch: https://github.com/puppetlabs/puppet/pull/1214


in puppet 2.7.x with hiera, one could use the following hierarchy:
<pre>
:hierarchy:
  - %{calling_module}
  - common
</pre>
In 3.x calling_module is no longer replaced with the proper value. This is 
because lookup is given a Puppet::Parser::Scope object which does not have the 
calling_module and calling_class keys. We need hiera to wrap the scope object 
with Hiera::Scope
<pre>
--- puppet/lib/hiera_puppet.rb.bak       2012-10-03 08:16:04.641709827 -0400
+++ puppet/lib/hiera_puppet.rb   2012-10-03 08:16:15.982710195 -0400
@@ -6,9 +6,7 @@
   module_function
 
   def lookup(key, default, scope, override, resolution_type)
-    unless scope.respond_to?("[]")
-      scope = Hiera::Scope.new(scope)
-    end
+    scope = Hiera::Scope.new(scope)
 
     answer = hiera.lookup(key, default, scope, override, resolution_type)
</pre>


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