diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-29 16:05:52 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-29 16:05:52 +0000 |
| commit | 56a28456c240bc25b89a4a6b02e39aaaef162391 (patch) | |
| tree | c55f0f045f69ccd5ccd2cce74b330419636c6584 /lib | |
| parent | d2754895ead8e8b036e29a628e3de9fad1abba34 (diff) | |
| download | puppet-56a28456c240bc25b89a4a6b02e39aaaef162391.tar.gz puppet-56a28456c240bc25b89a4a6b02e39aaaef162391.tar.xz puppet-56a28456c240bc25b89a4a6b02e39aaaef162391.zip | |
Adding report collection to both statechange and transaction.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1336 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/statechange.rb | 5 | ||||
| -rw-r--r-- | lib/puppet/transaction.rb | 6 | ||||
| -rw-r--r-- | lib/puppet/type.rb | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/lib/puppet/statechange.rb b/lib/puppet/statechange.rb index d11cb6734..4884026fe 100644 --- a/lib/puppet/statechange.rb +++ b/lib/puppet/statechange.rb @@ -7,6 +7,9 @@ module Puppet # including calling 'sync' on the states and producing events. class StateChange attr_accessor :is, :should, :type, :path, :state, :transaction, :changed + + # The log file generated when this object was changed. + attr_reader :report def initialize(state) @state = state @@ -68,7 +71,7 @@ module Puppet # should basically point to that, right? #:state => @state, #:object => @state.parent, - @state.log @state.change_to_s + @report = @state.log(@state.change_to_s) Puppet::Event.new( :event => event, :change => self, diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 20b65abed..0281f16ed 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -211,6 +211,12 @@ class Transaction end end + def report + @changes.collect do |change| + change.report + end + end + # Roll all completed changes back. def rollback @targets.clear diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index b666317bb..06ebab9e7 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -1442,13 +1442,6 @@ class Type < Puppet::Element if self.respond_to?(:validate) self.validate end - - # Ensure defaults to present for managed objects, but not otherwise. - # Because of this complication, we can't use normal defaulting mechanisms -# if ! @states.include?(:ensure) and self.managed? and -# self.class.validstate?(:ensure) -# self[:ensure] = :present -# end end # Figure out of there are any objects we can automatically add as |
