diff options
author | Ethan Rowe <ethan@endpoint.com> | 2009-07-31 15:26:37 -0400 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | ba2a3afb45199e3b85db03a1bb54a925bffce08f (patch) | |
tree | e32d21458c7feb921d234ad05d1145cc5dfd3ee0 /lib/puppet/transaction.rb | |
parent | 9cb68417670d6bc98caf1169af4ecafb59f4c14c (diff) | |
download | puppet-ba2a3afb45199e3b85db03a1bb54a925bffce08f.tar.gz puppet-ba2a3afb45199e3b85db03a1bb54a925bffce08f.tar.xz puppet-ba2a3afb45199e3b85db03a1bb54a925bffce08f.zip |
Fix 2239 (step five): introduce new Puppet::Transaction#stop_processing? flag and associated check thereof within the resource evaluation code. This should allow for the transaction to bail out of its processing if it finds that a stop has been requested, based on the state of Puppet::Application.stop_requested?.
Diffstat (limited to 'lib/puppet/transaction.rb')
-rw-r--r-- | lib/puppet/transaction.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 4d82d3331..e9a193464 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -3,6 +3,7 @@ require 'puppet' require 'puppet/util/tagging' +require 'puppet/application' class Puppet::Transaction require 'puppet/transaction/change' @@ -26,6 +27,11 @@ class Puppet::Transaction include Puppet::Util include Puppet::Util::Tagging + # Wraps application run state check to flag need to interrupt processing + def stop_processing? + Puppet::Application.stop_requested? + end + # Add some additional times for reporting def add_times(hash) hash.each do |name, num| @@ -135,6 +141,7 @@ class Puppet::Transaction begin @sorted_resources.each do |resource| + next if stop_processing? if resource.is_a?(Puppet::Type::Component) Puppet.warning "Somehow left a component in the relationship graph" next |