diff options
author | Luke Kanies <luke@reductivelabs.com> | 2010-01-19 23:24:24 -0800 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 386b3e567f09c1ff1eb8ba4bb0a4f6432d3fab31 (patch) | |
tree | e9793c388ecc72fe18e920a93d57bb7a63529280 /lib | |
parent | fbd5b0a2d67b28c3e9ab0f161c1bcfa918ee0b6e (diff) | |
download | puppet-386b3e567f09c1ff1eb8ba4bb0a4f6432d3fab31.tar.gz puppet-386b3e567f09c1ff1eb8ba4bb0a4f6432d3fab31.tar.xz puppet-386b3e567f09c1ff1eb8ba4bb0a4f6432d3fab31.zip |
Fixing #2759 - reports now have complete change info
This includes every event generated in the transaction
and a Resource::Status object for each resource managed,
with per-resource information in it.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/transaction.rb | 6 | ||||
-rw-r--r-- | lib/puppet/transaction/event_manager.rb | 6 | ||||
-rw-r--r-- | lib/puppet/transaction/report.rb | 12 |
3 files changed, 8 insertions, 16 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 9da761a8c..b49d12266 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -330,8 +330,6 @@ class Puppet::Transaction @event_manager = Puppet::Transaction::EventManager.new(self) @resource_harness = Puppet::Transaction::ResourceHarness.new(self) - - @resource_status = {} end # Prefetch any providers that support it. We don't support prefetching @@ -399,11 +397,11 @@ class Puppet::Transaction end def add_resource_status(status) - @resource_status[status.resource] = status + report.add_resource_status status end def resource_status(resource) - @resource_status[resource.to_s] + report.resource_statuses[resource.to_s] end # Roll all completed changes back. diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb index 89c4b9297..a6ca8a229 100644 --- a/lib/puppet/transaction/event_manager.rb +++ b/lib/puppet/transaction/event_manager.rb @@ -13,10 +13,6 @@ class Puppet::Transaction::EventManager transaction.relationship_graph end - def report - transaction.report - end - # Respond to any queued events for this resource. def process_events(resource) restarted = false @@ -37,8 +33,6 @@ class Puppet::Transaction::EventManager def queue_event(resource, event) @events << event - report.register_event event - # Collect the targets of any subscriptions to those events. We pass # the parent resource in so it will override the source in the events, # since eval_generated children can't have direct relationships. diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb index 5a0332f66..787ef19ad 100644 --- a/lib/puppet/transaction/report.rb +++ b/lib/puppet/transaction/report.rb @@ -10,7 +10,7 @@ class Puppet::Transaction::Report indirects :report, :terminus_class => :processor - attr_reader :events, :logs, :metrics, :host, :time + attr_reader :resource_statuses, :logs, :metrics, :host, :time # This is necessary since Marshall doesn't know how to # dump hash with default proc (see below @records) @@ -23,10 +23,14 @@ class Puppet::Transaction::Report return self end + def add_resource_status(status) + @resource_statuses[status.resource] = status + end + def initialize @metrics = {} @logs = [] - @events = [] + @resource_statuses = {} @host = Puppet[:certname] @time = Time.now end @@ -46,10 +50,6 @@ class Puppet::Transaction::Report @metrics[metric.name] = metric end - def register_event(event) - @events << event - end - # Provide a summary of this report. def summary ret = "" |