diff options
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 = "" |