On 07/18/2013 03:07 PM, jcbollinger wrote:

> Not to my knowledge, no.
> 
> This is not the correct provider paradigm.  The provider for a given
> resource type used on a given node, if not specified explicitly, is
> supposed to be chosen based on the characteristics of the node, not of
> the resource.  You seem to be artificially separating your provider into
> two pieces.  My recommendation would be to create one provider whose
> behavior varies according to the resource's properties, instead of
> trying to make the choice between different providers depend on resource
> properties.

Thing I'm trying to accomplish is to enable the 'cobblerdistro' provider
to be able to add new distro to cobbler either via 'cobbler distro add'
or 'cobbler import'.

Those two commands work very differently, and although a result of both
is a 'distro' (in cobbler terms), they are quite different.

So, I was thinking maybe to develop separate providers, and the one that
is called depends on the params/properties set.


> I think you can use the property validation hook to accomplish this.  It
> is focused on validating individual properties, and there is no
> guarantee of which property will be validated first, but all you really
> need is to raise / check a flag an the resource instance as part of the
> validation of each of those properties.  You raise an ArgumentError if
> the validation code for either property finds that the flag is already
> raised.  See http://docs.puppetlabs.com/guides/custom_types.html for
> general details on the property validation hook.

OK, I will try that.


> No, puppet-dev is for discussion of the development of Puppet itself,
> not for questions about its use.  "Development" of Puppet manifests is a
> usage issue with respect to the Puppet program.

Although this is a provider discussion and not pure manifest... that's
why I asked.


Thank you jcbollinger!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to