From e6698c2b8624fe2c2bbeef594318e3e8d932d345 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Thu, 25 Sep 2008 16:05:57 +0100 Subject: Add warning and forcibly set to :md5 fixing #1564 --- lib/puppet/type/file/checksum.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/puppet') 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] -- cgit