diff options
author | Luke Kanies <luke@madstop.com> | 2009-11-01 15:09:43 -0500 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 4be86015bd0a663f9e662186f7acbf8c3c8b421f (patch) | |
tree | 9a3ff142336ead0cecc2af9e659a3a6445a992b1 /lib/puppet | |
parent | 2aa579bdbd91db2cd9a154e0ead2b327fa9a8474 (diff) | |
download | puppet-4be86015bd0a663f9e662186f7acbf8c3c8b421f.tar.gz puppet-4be86015bd0a663f9e662186f7acbf8c3c8b421f.tar.xz puppet-4be86015bd0a663f9e662186f7acbf8c3c8b421f.zip |
Adding Transaction events to Transaction reports
This means that every event generated during a transaction,
with all of its metadata, will now be in the report.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/transaction/event_manager.rb | 6 | ||||
-rw-r--r-- | lib/puppet/transaction/report.rb | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb index 370938c5e..da282ec8e 100644 --- a/lib/puppet/transaction/event_manager.rb +++ b/lib/puppet/transaction/event_manager.rb @@ -13,6 +13,10 @@ 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 @@ -33,6 +37,8 @@ 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 6d365a5f9..45a249f48 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_accessor :logs, :metrics, :time, :host + attr_reader :events, :logs, :metrics, :host, :time # This is necessary since Marshall doesn't know how to # dump hash with default proc (see below @records) @@ -26,6 +26,7 @@ class Puppet::Transaction::Report def initialize @metrics = {} @logs = [] + @events = [] @host = Puppet[:certname] end @@ -44,6 +45,10 @@ 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 = "" |