On Fri, Jan 30, 2015 at 2:34 PM, Eli Young <[email protected]> wrote:

> On Friday, January 30, 2015 at 12:24:25 PM UTC-8, Nan Liu wrote:
>>
>> I was able to work around this by abusing self.prefetch, since the
>> transaction layer passes in a subset of resources:
>>
>> def self.prefetch(resources)
>>     catalog = resources[resources.keys.first].catalog
>>     # Note: catalog.resources != resources
>>     splunk_config = catalog.resources.find{|s| s.type == :splunk_config}
>>     confdir = splunk_config['forwarder_confdir'] || raise(Puppet::Error,
>> 'Unknown splunk forwarder confdir')
>>     @file_path = File.join(confdir, 'outputs.conf')
>> end
>>
>
> Is abusing prefetch even necessary?  I'm fairly certain that you can
> access the catalog from the provider via resource.catalog.
>

resource does not appear to be available in self.* class methods, only
instance methods.

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CACqVBqAnxjTCy6AMs9WVpFbzk%2B9uFYxGarD-C3B2tBsc5cMkSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to