On Wed, Jan 19, 2011 at 09:25:35AM -0700, Thomas S Hatch wrote:
> I know that the pacman type for Archlinux puppet support is not yet official
> (I really need to write those darn tests), but I am having trouble with what
> seems to be a race condition, and I was hoping that you guys could shed some
> light on the situation.
> 
> The vast majority of the time puppet runs without problems on my Arch
> systems, but every now and then I get a false positive from a package
> install, then a file which is requires the package gets laid down, then the
> next time puppet runs the package fails to install because the file is
> already on the system. But the real concern is that I am getting a false
> positive for an installed package.

What exactly do you mean by »false positive«? Puppet reports a package
as installed while it's not (maybe wrong regex in instances classmethod)
or that puppet reports a successful installation while in fact there
were errors?

When I understand your provider correctly you install a package and
afterwards try to query that package with

  pacman -Qi <PACKAGENAME>

What does this command report for an absent package? If pacman returns
just nothing your query method returns an empty hash. And an empty hash
is true so your unless case in your install method is never checked.

You should check what pacman returns when errors occur or if you try to
install a package that is not in your database. If it returns something <>
0 you can strip your install method down to your pacman call.
> 
> The pacman.rb type I am using can be found here:
> https://aur.archlinux.org/packages/puppet/puppet/pacman.rb
> 
> Please help me figure out why I am getting a false positive on this :)
> 
> Also, the puppetmaster is on ubuntu 10.04 and is running puppet 0.25 and the
> client is 2.6.4, will this cause any problems?
> 
I guess this can be a problem too

-Stefan

Attachment: pgpVOXhZFwDzC.pgp
Description: PGP signature

Reply via email to