From 1dfd55408d3a9f5c609ee562d0e948c15c5629fb Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 13 Jun 2006 21:23:58 +0000 Subject: Fixing packaging to deal with the fact that yum exits with 0 exit code even when it is told to install a non-existent package. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1263 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/type/package.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index 073336b20..8c9458372 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -133,13 +133,18 @@ module Puppet @parent[:type] ) end + + # Because yum always exits with a 0 exit code, there's a retrieve + # in the "install" method. So, check the current state now, + # to compare against later. + current = self.is begin @parent.update rescue => detail self.fail "Could not update: %s" % detail end - if self.is == :absent + if current == :absent return :package_created else return :package_changed -- cgit