summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/settings.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-05-07 12:29:58 -0500
committerLuke Kanies <luke@madstop.com>2008-05-07 12:29:58 -0500
commit330359015602eba83077fccaa708c819d2d78b53 (patch)
treeab124f5ae2a2493218b45b48cb3f07d9c8087f4a /lib/puppet/util/settings.rb
parent8fd68e388aa0b26d2dacc201086960385ff5c834 (diff)
downloadpuppet-330359015602eba83077fccaa708c819d2d78b53.tar.gz
puppet-330359015602eba83077fccaa708c819d2d78b53.tar.xz
puppet-330359015602eba83077fccaa708c819d2d78b53.zip
The master and client now successfully speak xmlrpc using the new system.
The server is actually serving REST, but the client can't use it until we resolve the format and security issues that REST hasn't yet tackled.
Diffstat (limited to 'lib/puppet/util/settings.rb')
-rw-r--r--lib/puppet/util/settings.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 09bba5b59..1b953c95e 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -699,13 +699,19 @@ Generated on #{Time.now}.
[file]
end
- writesub(default, tmpfile, *args, &bloc)
+ # If there's a failure, remove our tmpfile
+ begin
+ writesub(default, tmpfile, *args, &bloc)
+ rescue
+ File.unlink(tmpfile) if FileTest.exist?(tmpfile)
+ raise
+ end
begin
File.rename(tmpfile, file)
rescue => detail
- Puppet.err "Could not rename %s to %s: %s" %
- [file, tmpfile, detail]
+ Puppet.err "Could not rename %s to %s: %s" % [file, tmpfile, detail]
+ File.unlink(tmpfile) if FileTest.exist?(tmpfile)
end
end
end