2010/2/1 Markus Roberts <[email protected]>

> Alban --
>
> As I noted on your ticket (#3136) I'm not seeing why adding a require
> statement at the top of the provider wouldn't solve this issue.  See,
> for example, lib/puppet/provider/package/appdmg.rb which starts thusly
> (after the header comments):
>
> require 'puppet/provider/package'
> Puppet::Type.type(:package).provide(:appdmg, :parent =>
> Puppet::Provider::Package) do
>    desc "Package management which copies application bundles to a target."
>
> This is the normal way of dealing with dependencies--make them explicit.
>
> -- Markus
>
> Because james told me it could be an issue:
<prahal> ok I got rid of the issue with type behing loaded after the
provider that requires them by adding 'require "puppet/type"' in the first
loaded provider ... seems hackish though
<prahal> I wonder if I ought not to find a better fix before submitting a
patch to the author
<Volcane> I'd mail the dev list and ask
<jamesturnbull> prahal: I'd say there is a bug in the type/provider - that
is not normal behaviour
<prahal> jamesturnbull, you mean  provider cannot use a type that is defined
in the same module (as automatic loader load custom-module/type after
custom-module/provider) ?
<prahal> if so yes the module puppet-mysql is heavily broken
<prahal> though I read that a module is not supposed to depend on another
module . This means  custom types cannot be loaded in a provider at all
<jamesturnbull> prahal: I don't know this type/provider but I've never
needed to put "require" into a provider to make it load the type
<jamesturnbull> prahal: hmmm it should load type first
<prahal> as far as the log show it looks like the directories under lib are
loaded in alphabetical order when "Loading downloaded plugin" ie puppet/type
is after facter/ puppet/parser puppet/provider
<prahal> I agree that it would make more sense to have the plugin loader
load type first else it is not possibble to use them .
<prahal> as I see now it looks like "Loading downloaded plugin" only happens
once . After maybe the type are loaded first but after first deployment not
<jamesturnbull> prahal: can you please log a ticket on this?


So :
require "puppet/type"
is ok in the provider and would load the module type even if they were never
loaded previously ?

Best regards,
Alban

-- 
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