puppet-php
puppet-php copied to clipboard
require pear in pecl file
This fixes the pecl
provider autoloading the pear
provider. On Puppet 4.9.4, I get the following error:
Puppet::Error:
Could not autoload puppet/type/package: Could not autoload puppet/provider/package/pecl: cannot load such file -- puppet/provider/pear
It doesn't seem to happen on Puppet 3. This is fixed by requiring pear
explicitly in the pecl
provider code.
It looks like my original fix might not actually work, even though it solved the problem on my dev host, it then couldn't find puppet/provider/package/pear
on our CI host. I'm now doing require_relative './pear'
.
Could not reproduce with puppet 4.10.0 (agent and master) and the following manifest in /etc/puppetlabs/code/environments/production/manifests/php.pp:
include apt
class { 'php': }
php::extension { 'event':
provider => 'pecl',
}
The extension is installed correctly:
root@a75003b4bbfb:/# pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
event 2.3.0 stable
Looks like an autoload issue on your side. Are your modules in the standard path, under production (or current) environment?
At the moment it seems like it only causes problems when I use rspec-puppet
. The other strange thing is that it only fails for the first test. Subsequent tests seem to have loaded the file correctly.
I don't know if it's actually related to the error that it prints before that. Here is some context:
Failure/Error: Puppet::Type.type(:package).stubs(:defaultprovider).returns(Puppet::Type.type(:package).provider(:apt))
Puppet::Error:
Could not autoload puppet/type/package: Could not autoload puppet/provider/package/pecl: Could not find parent provider pear of pecl
What's the exact reproduction? Do you just invoke rake spec
on current master?
It does it for tests under spec/hosts
, and I just run rake spec
.
Just to be clear, this is running in our codebase, not this module. I wonder if it's actually a problem with rspec-puppet
.
Can you please clarify? Are you saying that this module trips up rspec-puppet running the custom tests in your own codebase? Is this module pulled as a dependency there?
Yes, the problem happens running our own tests where this module is a dependency, and only for hosts tests. So I'm actually wondering if this is a problem with rspec-puppet
and not this module.
If you can create a clone of your environment and strip it down to the bare essentials that will still demonstrate this issue, that would be very helpful to have.
@jarro2783 can you please rebase against our latest master? We added acceptance tests and should now be able to reproduce this.