diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-25 00:31:34 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-25 00:31:34 +0000 |
commit | ee818a96233e62d9c37a117265c6d68f78095689 (patch) | |
tree | db8b9e0ebbef46dfa2e91377a20ba36e3b93c7d4 | |
parent | 63afa37f6730a18a6d0fb8998f09e40ca9ff1e40 (diff) | |
download | puppet-ee818a96233e62d9c37a117265c6d68f78095689.tar.gz puppet-ee818a96233e62d9c37a117265c6d68f78095689.tar.xz puppet-ee818a96233e62d9c37a117265c6d68f78095689.zip |
Adding some debugging to list the states being changed when in debug mode
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@949 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/type.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 9a80f18bb..a8cfe592a 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -1655,10 +1655,11 @@ class Type < Puppet::Element def statechanges # If we are changing the existence of the object, then none of # the other states matter. + changes = nil if @states.include?(:ensure) and ! @states[:ensure].insync? #self.info "ensuring %s from %s" % # [@states[:ensure].should, @states[:ensure].is] - return [Puppet::StateChange.new(@states[:ensure])] + changes = [Puppet::StateChange.new(@states[:ensure])] # Else, if the 'ensure' state is correctly absent, then do # nothing elsif @states.include?(:ensure) and @states[:ensure].is == :absent @@ -1671,12 +1672,22 @@ class Type < Puppet::Element #else # self.info "no ensure state" #end - return states().find_all { |state| + changes = states().find_all { |state| ! state.insync? }.collect { |state| Puppet::StateChange.new(state) } end + + if Puppet[:debug] and changes.length > 0 + self.debug("Changing " + changes.collect { |ch| + self.info ch.state.class + ch.state.name + }.join(",") + ) + end + + changes end # this method is responsible for collecting state changes |