summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-04-08 01:00:46 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitbf2f08869ced5a0cac8e399f6bc35ea2c4ddc44c (patch)
tree1b84c4dcfb5e65745b0b290d18ac38c60823eacc /lib/puppet
parent50ed75b5c2bca5edeec2a3a6f60f6b5c16483a1a (diff)
downloadpuppet-bf2f08869ced5a0cac8e399f6bc35ea2c4ddc44c.tar.gz
puppet-bf2f08869ced5a0cac8e399f6bc35ea2c4ddc44c.tar.xz
puppet-bf2f08869ced5a0cac8e399f6bc35ea2c4ddc44c.zip
Generated resources' events are actually bound to the resource that
generated them.
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/transaction.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index e7d8f63fd..5f105b220 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -39,10 +39,10 @@ class Puppet::Transaction
end
# Apply all changes for a resource
- def apply(resource)
+ def apply(resource, ancestor = nil)
status = resource_harness.evaluate(resource)
add_resource_status(status)
- event_manager.queue_events(resource, status.events)
+ event_manager.queue_events(ancestor || resource, status.events)
rescue => detail
resource.err "Could not evaluate: #{detail}"
end
@@ -87,19 +87,19 @@ class Puppet::Transaction
end
# Evaluate a single resource.
- def eval_resource(resource)
+ def eval_resource(resource, ancestor = nil)
if skip?(resource)
resource_status(resource).skipped = true
return
end
- eval_children_and_apply_resource(resource)
+ eval_children_and_apply_resource(resource, ancestor)
# Check to see if there are any events queued for this resource
event_manager.process_events(resource)
end
- def eval_children_and_apply_resource(resource)
+ def eval_children_and_apply_resource(resource, ancestor = nil)
resource_status(resource).scheduled = true
# We need to generate first regardless, because the recursive
@@ -109,16 +109,16 @@ class Puppet::Transaction
if ! children.empty? and resource.depthfirst?
children.each do |child|
# The child will never be skipped when the parent isn't
- eval_resource(child, false)
+ eval_resource(child, ancestor || resource)
end
end
# Perform the actual changes
- apply(resource)
+ apply(resource, ancestor)
if ! children.empty? and ! resource.depthfirst?
children.each do |child|
- eval_resource(child)
+ eval_resource(child, ancestor || resource)
end
end
end