summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-06-14 09:38:36 -0600
committerAndrew Shafer <andrew@reductivelabs.com>2008-06-14 09:38:36 -0600
commit86f8ff4fb5fa69dc59afeea4260d1a875f37d483 (patch)
treed34ebef1881384f893ab35e4bfc2f3e91bbf41b7 /lib/puppet/provider
parent7b2c310e18b214424ae082e6ed2354a07b708c6f (diff)
downloadpuppet-86f8ff4fb5fa69dc59afeea4260d1a875f37d483.tar.gz
puppet-86f8ff4fb5fa69dc59afeea4260d1a875f37d483.tar.xz
puppet-86f8ff4fb5fa69dc59afeea4260d1a875f37d483.zip
Removed the unless condition in query, because the issue is a stale cached
value and added comments that query will now always do so. The query method is only called in two places, from inside 'install' in yum.rb and from inside 'uninstall' in rpm. This behavior only happens when you have a lower version than the one you are 'ensuring'. Since the right package actually gets installed, the system is in sync next time, but the event of installation is lost and subscribing resources will never get it.
Diffstat (limited to 'lib/puppet/provider')
-rwxr-xr-xlib/puppet/provider/package/rpm.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb
index 35684e11d..a303da4e2 100755
--- a/lib/puppet/provider/package/rpm.rb
+++ b/lib/puppet/provider/package/rpm.rb
@@ -43,19 +43,20 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr
# a hash with entries :instance => fully versioned package name, and
# :ensure => version-release
def query
- unless @property_hash[:epoch]
- cmd = ["-q", @resource[:name], "--nosignature", "--nodigest", "--qf", "#{NEVRAFORMAT}\n"]
-
- begin
- output = rpm(*cmd)
- rescue Puppet::ExecutionFailure
- return nil
- end
-
- # FIXME: We could actually be getting back multiple packages
- # for multilib
- @property_hash.update(self.class.nevra_to_hash(output))
+ #NOTE: Prior to a fix for issue 1243, this method potentially returned a cached value
+ #IF YOU CALL THIS METHOD, IT WILL CALL RPM
+ #Use get(:property) to check if cached values are available
+ cmd = ["-q", @resource[:name], "--nosignature", "--nodigest", "--qf", "#{NEVRAFORMAT}\n"]
+
+ begin
+ output = rpm(*cmd)
+ rescue Puppet::ExecutionFailure
+ return nil
end
+
+ # FIXME: We could actually be getting back multiple packages
+ # for multilib
+ @property_hash.update(self.class.nevra_to_hash(output))
return @property_hash.dup
end