From e7d98ccbc0021bace65dd8525e730462947e5049 Mon Sep 17 00:00:00 2001 From: Markus Roberts Date: Sat, 2 Jan 2010 10:09:51 -0800 Subject: Fix for #2999 (absent package handling on solaris) The fix for #2940 resulted in a behavior change that could be seen as a bug. This was consistent with many of the other providers (see #3000) but was not the desired behavior. This patch enhances the patch for #2940 to return {:ensure => :absent} as the present state in the case that the failure was due to the package not being installed (as opposed to a source/index failure, etc.). The other possibility would have been {:ensure => :purged}. --- lib/puppet/provider/package/sun.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/puppet/provider/package/sun.rb b/lib/puppet/provider/package/sun.rb index cd511b1af..4f8b311ab 100755 --- a/lib/puppet/provider/package/sun.rb +++ b/lib/puppet/provider/package/sun.rb @@ -112,6 +112,7 @@ Puppet::Type.type(:package).provide :sun, :parent => Puppet::Provider::Package d } return hash rescue Puppet::ExecutionFailure => detail + return {:ensure => :absent} if detail.message =~ /information for "#{Regexp.escape(@resource[:name])}" was not found/ puts detail.backtrace if Puppet[:trace] raise Puppet::Error, "Unable to get information about package #{@resource[:name]} because of: #{detail}" end -- cgit