diff options
| author | Luke Kanies <luke@madstop.com> | 2008-03-18 13:55:48 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-03-18 13:55:48 -0500 |
| commit | d0554db2396794391c7b9f54609e0aef37ac579d (patch) | |
| tree | ac1dd10fd250875bed50fc2d9b573ab5038986e0 /lib | |
| parent | 13c6de34951faa574ca53bba99505ddb9daa6c71 (diff) | |
| download | puppet-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')
| -rw-r--r-- | lib/puppet/util/settings.rb | 15 |
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 |
