diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-06-15 12:26:10 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-06-15 12:26:10 +1000 |
commit | 57945a588c942198d4827263b46476a477dce7d0 (patch) | |
tree | 524cb7ba9e1bfaa7c6f082da2e75f3da8205c9ca /lib | |
parent | 575f37a0656f5a1f94fe6fb1b189d1701a98cadc (diff) | |
parent | 86f8ff4fb5fa69dc59afeea4260d1a875f37d483 (diff) | |
download | puppet-57945a588c942198d4827263b46476a477dce7d0.tar.gz puppet-57945a588c942198d4827263b46476a477dce7d0.tar.xz puppet-57945a588c942198d4827263b46476a477dce7d0.zip |
Merge branch 'ticket/0.24.x/1243' of git://github.com/littleidea/puppet into 0.24.x
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/puppet/provider/package/rpm.rb | 25 |
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 |