Issue #4929 has been updated by Markus Roberts. Target version changed from 2.6.2 to 2.6.x
This appears to be a change introduced by: <pre> commit 021d534482dd8edb863cb77d668ac3525362a0a6 Author: James Turnbull <[email protected]> Date: Thu Sep 23 08:45:26 2010 +1000 Fixed #3707 - rpm, like dpkg-query exits 1 if the package is not installed. Returning nil in this provider had the effect that on every run, puppet would end up calling yum erase . Returning the correct data structure resolves this. Thanks to Stephen Gran for the patch diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb index 72dc260..ec61217 100755 --- a/lib/puppet/provider/package/rpm.rb +++ b/lib/puppet/provider/package/rpm.rb @@ -60,7 +60,8 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr begin output = rpm(*cmd) rescue Puppet::ExecutionFailure - return nil + # rpm exits 1 if the package is not found. + return {:ensure => :purged, :status => 'missing', :name => @resource[:name], :error => 'ok'} end # FIXME: We could actually be getting back multiple packages </pre> ---------------------------------------- Bug #4929: no error reported when installing an unavalable package through yum provider in 2.6.2rc1 http://projects.puppetlabs.com/issues/4929 Author: Xavier Delaruelle Status: Accepted Priority: High Assignee: Category: package Target version: 2.6.x Affected version: 2.6.2rc1 Keywords: Branch: Hello, When trying to install a package that do not exit on a CentOS 5 host, puppet 2.6.2rc1 does not complain and everything seems ok whereas the package is not installed at the end of the run. <pre> cat test-pkg.pp package { "fake_package": ensure => installed, } # puppet apply test-pkg.pp /usr/lib/ruby/site_ruby/1.8/puppet/util/metric.rb:62: warning: parenthesize argument(s) for future version notice: /Stage[main]//Package[fake_package]/ensure: ensure changed 'purged' to 'present' # rpm -qa fake_package # yum search fake_package ... No Matches found </pre> Regards, Xavier -- 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.
