summaryrefslogtreecommitdiffstats
path: root/lib/puppet/client.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-08 00:02:23 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-08 00:02:23 +0000
commitcbf10c5e365fb7440c89321a2c329e40424d30b4 (patch)
tree6be719c4848e73d75d8661f240cd4e1e2f1f2a1d /lib/puppet/client.rb
parent23f982ecda3fd74867d404b5e784f072db9a1cde (diff)
downloadpuppet-cbf10c5e365fb7440c89321a2c329e40424d30b4.tar.gz
puppet-cbf10c5e365fb7440c89321a2c329e40424d30b4.tar.xz
puppet-cbf10c5e365fb7440c89321a2c329e40424d30b4.zip
Merging changes from the head of the rework1 branch, r 784
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@787 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client.rb')
-rw-r--r--lib/puppet/client.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/client.rb b/lib/puppet/client.rb
index 56e78349a..80b9fe30f 100644
--- a/lib/puppet/client.rb
+++ b/lib/puppet/client.rb
@@ -20,6 +20,7 @@ begin
require 'xmlrpc/server'
rescue LoadError => detail
$noclientnetworking = detail
+ raise Puppet::Error, "You must have the Ruby XMLRPC, CGI, and Webrick libraries installed"
end
module Puppet
@@ -413,9 +414,17 @@ module Puppet
if tmp = @driver.getfile(sum)
newcontents = Base64.decode64(tmp)
newsum = Digest::MD5.hexdigest(newcontents)
+ changed = nil
+ unless FileTest.writable?(file)
+ changed = File.stat(file).mode
+ File.chmod(changed | 0200, file)
+ end
File.open(file,File::WRONLY|File::TRUNC) { |of|
of.print(newcontents)
}
+ if changed
+ File.chmod(changed, file)
+ end
else
Puppet.err "Could not find file with checksum %s" % sum
return nil