diff options
author | Luke Kanies <luke@madstop.com> | 2008-07-04 16:32:04 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-07-04 16:32:04 -0500 |
commit | 9d69b3fd12f90ddead7b6a3392395fbe4e901d9b (patch) | |
tree | bd8a4e16ed9c0e34568ea321d152e786f1e6090a /lib | |
parent | 61ec332144ad794fae80a16feac543afc014a5f9 (diff) | |
download | puppet-9d69b3fd12f90ddead7b6a3392395fbe4e901d9b.tar.gz puppet-9d69b3fd12f90ddead7b6a3392395fbe4e901d9b.tar.xz puppet-9d69b3fd12f90ddead7b6a3392395fbe4e901d9b.zip |
Testing and simplifying the Transaction::Change#backward method.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/transaction/change.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/puppet/transaction/change.rb b/lib/puppet/transaction/change.rb index 396b9233e..e05c2592c 100644 --- a/lib/puppet/transaction/change.rb +++ b/lib/puppet/transaction/change.rb @@ -4,24 +4,15 @@ require 'puppet/transaction/event' # Handle all of the work around performing an actual change, # including calling 'sync' on the properties and producing events. class Puppet::Transaction::Change - attr_accessor :is, :should, :type, :path, :property, :changed, :proxy - - # The log file generated when this object was changed. - attr_reader :report + attr_accessor :is, :should, :path, :property, :changed, :proxy # Switch the goals of the property, thus running the change in reverse. def backward - @property.should = @is - @is = @property.retrieve + @is, @should = @should, @is + @property.should = @should - unless @property.insync?(@is) - @property.info "Backing %s" % self - return self.go - else - @property.debug "rollback is already in sync: %s vs. %s" % - [@is, @property.should.inspect] - return nil - end + @property.info "Reversing %s" % self + return self.go end def changed? |