On Jan 30, 2015, at 1:37 AM, Nan Liu <nan....@gmail.com> wrote:
> 
> I'm trying to use ini_setting as a parent provider. Everything works well, 
> but to support purging, the resources provider need to specify the target 
> file via self.file_path. Initially this seems straightforward, but the config 
> file location can vary based on installation settings. All the examples I've 
> seen have a hard coded filepath in self.file_path. I can't use parameter in 
> the puppet type to provide the file path because it's only accessible in the 
> normal setter/getter via resources[:file_path]. scope.lookupvar is definitely 
> not available, so is there a way to access the catalog in self.* methods in 
> the provider?


The self.* methods are class methods, so they shouldn’t generally have access 
to per-run values like the catalog.

How are you setting the path for the file?  You could maybe have that process 
set the path variable on the provider.

It might be that there’s a global means of finding the catalog, too — something 
equivalent to Environment.current or whatever it is — but I can’t remember.

— 
http://puppetlabs.com/ | http://about.me/lak | @puppetmasterd

-- 
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/010E3EB2-C4D5-4E8E-87AD-96CEE9366B89%40puppetlabs.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to