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.

>

-- 
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 puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/a395a3af-4256-49f7-8767-8ed1f57a8388%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to