Issue #17747 has been updated by Josh Cooper.

Jeff McCune wrote:
> If provider suitability is used to determine if the gem dependency is 
> satisfied, won't that require at least 2 puppet runs in the scenario where 
> the catalog configures the gem dependency itself?

As of 2.7.8, when puppet walks the DAG, it keeps track of suitable resources. 
Any resource that isn't suitable, e.g. it's provider uses a command that isn't 
on the system yet, is deferred until "later". Eventually puppet will 
re-evaluate the suitability of the resource (and its provider). This works for 
provider confines based on `Puppet::Provider::Confine::Exists`, since we retest 
suitability each time.

But providers confined based on features didn't work, because we evaluated and 
cached the negative result. This is fixed in #14822 (2.7.20), e.g. for 
`Puppet.features.augeas?`, at least for some usages of features (ones that 
don't take a block...). I think if your custom provider is doing `confine 
:feature => :yourfeature` and yourfeature simply does 
`Puppet.features.add(:yourfeature, :libs => ["json"])`, then it should work 
(using 2.7.20), and this is a duplicate of #14822.

----------------------------------------
Bug #17747: Inability to use gems as dependencies in custom providers & types
https://projects.puppetlabs.com/issues/17747#change-77325

Author: Mohit Chawla
Status: Needs Decision
Priority: Normal
Assignee: eric sorenson
Category: plug-ins
Target version: 3.x
Affected Puppet version: 2.7.19
Keywords: code_loading
Branch: 


I am using a custom provider that uses an external gem, for eg., json. I am 
seeing this behavior:

1) In the first puppet run - errors would be thrown like :
"err: Could not load downloaded file 
/var/lib/puppet/lib/puppet/provider/custom_provider/json.rb: no such file to 
load -- json".
However, the catalog compiles and gets executed successfully eventually in the 
same run, as I provide the json lib from my module. 

2) If however, there was some other error in the first run, say a syntax error 
somewhere, and then you try a successive puppet run, it simply doesn't retrieve 
the catalog,  with an error like: 
"Could not autoload custom: Could not autoload 
/var/lib/puppet/lib/puppet/provider/custom_provider/json.rb: no such file to 
load -- json"



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

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

Reply via email to