summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/file/checksum.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/type/file/checksum.rb b/lib/puppet/type/file/checksum.rb
index 3be147cb7..27edee13d 100755
--- a/lib/puppet/type/file/checksum.rb
+++ b/lib/puppet/type/file/checksum.rb
@@ -53,6 +53,9 @@ Puppet::Type.type(:file).newproperty(:checksum) do
else
if FileTest.directory?(@resource[:path])
return :time
+ elsif @resource[:source]
+ self.warning("Files with source set must use md5 as checksum. Forcing to md5 from %s for %s" % [ value, @resource[:path] ])
+ return :md5
else
return symbolize(value)
end
@@ -161,6 +164,7 @@ Puppet::Type.type(:file).newproperty(:checksum) do
checktype = :mtime if checktype == :timestamp
checktype = :ctime if checktype == :time
+ self.should = checktype = :md5 if @resource.property(:source)
file ||= @resource[:path]