On Wed, Jan 19, 2011 at 11:18 AM, Daniel Pittman <[email protected]>wrote:

> On Wed, Jan 19, 2011 at 08:25, Thomas S Hatch <[email protected]> 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.
>
> Package install is single-threaded, and we deliberately don't carry on
> to the next action until after your code has completed.
>
> > 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.
>
> So, I notice that you are using '-Sy' along with the package install;
> I went to verify part of how you were doing the query stuff and
> noticed https://wiki.archlinux.org/index.php/Pacman#Installing_packages
> strongly recommends that you *don't* do that because it causes
> dependency problems.
>
> What might be going wrong is that your double-check after the install
> runs is bad: in 'def query' you return a hash regardless of the
> package being installed or not.  In Ruby the empty hash is actually a
> true value, not false, so you *never* fail the self.query part of the
> 'install' method.
>
> My guess is that the install fails for some reason, but that you don't
> detect that failure from either the exit code or the not-quite-right
> double-check.
>
> Regards,
>    Daniel
>
> PS: You seem to have a mix of tabs and spaces in the code, in the
> 'latest' method, and to use 4-space tabs or something – it shows up in
> my 8-space tab viewer as being out-of-line.  We encourage spaces only
> for indentation.
> --
> ⎋ Puppet Labs Developer – http://puppetlabs.com
> ✉ Daniel Pittman <[email protected]>
> ✆ Contact me via gtalk, email, or phone: +1 (503) 893-2285
> ♲ Made with 100 percent post-consumer electrons
>
> --
> 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]<puppet-dev%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

Thanks! That should do it, I inherited this code and I have not spend the
time I should looking over it more, I will get this all cleaned up.

Thank you very much for the review!

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