summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-18 13:55:48 -0500
committerLuke Kanies <luke@madstop.com>2008-03-18 13:55:48 -0500
commitd0554db2396794391c7b9f54609e0aef37ac579d (patch)
treeac1dd10fd250875bed50fc2d9b573ab5038986e0 /lib/puppet
parent13c6de34951faa574ca53bba99505ddb9daa6c71 (diff)
downloadpuppet-d0554db2396794391c7b9f54609e0aef37ac579d.tar.gz
puppet-d0554db2396794391c7b9f54609e0aef37ac579d.tar.xz
puppet-d0554db2396794391c7b9f54609e0aef37ac579d.zip
Hopefully *finally* fixed the "already being managed" problem
(#1036). The problem only cropped up if there was a failure when trying to manage the system -- this would cause the setting-based resources not to get cleaned up.
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/util/settings.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 6e0b4b66d..366688944 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -669,14 +669,17 @@ Generated on #{Time.now}.
bucket = to_transportable(*sections)
- config = bucket.to_catalog
- config.host_config = false
- config.apply do |transaction|
- if failures = transaction.any_failed?
- raise "Could not configure for running; got %s failure(s)" % failures
+ begin
+ config = bucket.to_catalog
+ config.host_config = false
+ config.apply do |transaction|
+ if failures = transaction.any_failed?
+ raise "Could not configure for running; got %s failure(s)" % failures
+ end
end
+ ensure
+ config.clear
end
- config.clear
sections.each { |s| @used << s }
@used.uniq