summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-04-09 14:39:45 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-04-09 14:39:45 -0700
commit404bdfa15aae89b813ec1d86d6b5d20cae345dff (patch)
tree7f481abf55187656b00e62e94df0cda60bd845ec /lib
parente89549450434d09284bf1a851a39b74e71cb0d7f (diff)
downloadpuppet-404bdfa15aae89b813ec1d86d6b5d20cae345dff.tar.gz
puppet-404bdfa15aae89b813ec1d86d6b5d20cae345dff.tar.xz
puppet-404bdfa15aae89b813ec1d86d6b5d20cae345dff.zip
Repair validate_checksum codepath, even though it is disabled.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/file.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 8a21aa3f7..5b41538fd 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -744,7 +744,7 @@ Puppet::Type.newtype(:file) do
# And put our new file in place
if use_temporary_file # This is only not true when our file is empty.
begin
- fail_if_checksum_is_wrong(path, content) if validate
+ fail_if_checksum_is_wrong(path, content) if validate_checksum?
File.rename(path, self[:path])
rescue => detail
fail "Could not rename temporary file %s to %s : %s" % [path, self[:path], detail]
@@ -761,6 +761,10 @@ Puppet::Type.newtype(:file) do
private
+ def validate_checksum?
+ false
+ end
+
# Make sure the file we wrote out is what we think it is.
def fail_if_checksum_is_wrong(path, checksum)
# Use the appropriate checksum type -- md5, md5lite, etc.