Issue #15304 has been updated by eric sorenson.

Status changed from Unreviewed to Investigating


----------------------------------------
Bug #15304: Ruby DSL hostclass arguments should have access to scope.
https://projects.puppetlabs.com/issues/15304#change-68965

Author: Hunter Haugen
Status: Investigating
Priority: Normal
Assignee: Deepak Giridharagopal
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


When using a `hostclass` definition in a ruby dsl manifest like so:

<pre>
hostclass 'application', :arguments => {
  "instances" => scope.function_hiera_hash('instances')
} do
  ...
end
</pre>

I get this error from puppet:

<pre>
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
undefined local variable or method `scope' for 
#<Puppet::DSL::ResourceTypeAPI:0x2ae3951c9988> at 
/etc/puppetlabs/puppet/global/manifests/site.pp:54 on node [...]
</pre>

The line number is where the ruby dsl hostclass was included with the `include` 
keyword.

If I put the lookup into the hostclass block, it works fine.


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