On Oct 3, 2012, at 3:53 PM, Dan Bode <[email protected]> wrote:

> Hi Puppet devs,
> 
> I am trying to use a parent provider from another module.
> 
> I put the following code in the provider that wants to inherit from the 
> parent:
> 
> Puppet::Type.type(:ini_setting)#.providers
> 
> Puppet::Type.type(:keystone_config).provide(
>   :ini_setting,
>   :parent => Puppet::Type::Ini_setting::ProviderRuby
> 
> The important thing to note here is that I am calling Puppet::Type.type from 
> topscope to ensure that the type whose provider I want to inherit from is 
> properly loaded before I try to use the parent's constant when I create my 
> provider. (it looks like this also gets the providers for that type loaded)
> 
> Is there a better way to do this?

You should be able to just do:

Puppet::Type.type(:keystone_config).provide(:ini_setting, :parent => 
Puppet::Type::Ini_setting.provider_class(:ruby))

or whatever the specifics are.

I'm *nearly* sure it's "provider_class", but it'd be easy to confirm.

-- 
Luke Kanies | http://about.me/lak | http://puppetlabs.com/ | +1-615-594-8199

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.

Reply via email to