summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2011-01-07 15:47:19 -0800
committerPaul Berry <paul@puppetlabs.com>2011-01-07 15:47:19 -0800
commite6e88e7df7fa1cbec1400d73cb7ba9428c420be0 (patch)
tree5b5377e91a9188e68a52fc47525792a7ddc360b1 /lib
parenta02e6b88754021b1552e99b0131d86fcfdd7329b (diff)
parent8f314f2bb14d61a2a26b67d002d90f84349b25b5 (diff)
downloadpuppet-e6e88e7df7fa1cbec1400d73cb7ba9428c420be0.tar.gz
puppet-e6e88e7df7fa1cbec1400d73cb7ba9428c420be0.tar.xz
puppet-e6e88e7df7fa1cbec1400d73cb7ba9428c420be0.zip
Merge branch 'ticket/2.6.next/5710' into 2.6.next
* ticket/2.6.next/5710: (#5710) Removed unnecessary calls to insync? Prep for fixing #5710: Refactor stub provider in resource harness spec
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/transaction/resource_harness.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/puppet/transaction/resource_harness.rb b/lib/puppet/transaction/resource_harness.rb
index c259d3e05..c1b980632 100644
--- a/lib/puppet/transaction/resource_harness.rb
+++ b/lib/puppet/transaction/resource_harness.rb
@@ -37,7 +37,10 @@ class Puppet::Transaction::ResourceHarness
current_values = current.to_hash
historical_values = Puppet::Util::Storage.cache(resource).dup
- desired_values = resource.to_resource.to_hash
+ desired_values = {}
+ resource.properties.each do |property|
+ desired_values[property.name] = property.should
+ end
audited_params = (resource[:audit] || []).map { |p| p.to_sym }
synced_params = []
@@ -55,7 +58,7 @@ class Puppet::Transaction::ResourceHarness
elsif current_values[:ensure] != :absent
work_order = resource.properties # Note: only the resource knows what order to apply changes in
work_order.each do |param|
- if !param.insync?(current_values[param.name])
+ if desired_values[param.name] && !param.insync?(current_values[param.name])
events << apply_parameter(param, current_values[param.name], audited_params.include?(param.name), historical_values[param.name])
synced_params << param.name
end