diff options
Diffstat (limited to 'lib/puppet/type/file')
-rwxr-xr-x | lib/puppet/type/file/checksum.rb | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/lib/puppet/type/file/checksum.rb b/lib/puppet/type/file/checksum.rb index 76e27e55d..54d1c463b 100755 --- a/lib/puppet/type/file/checksum.rb +++ b/lib/puppet/type/file/checksum.rb @@ -11,11 +11,13 @@ Puppet::Type.type(:file).newproperty(:checksum) do like Tripwire without managing the file contents in any way. You can specify that a file's checksum should be monitored and then subscribe to the file from another object and receive events to signify - checksum changes, for instance. - + checksum changes, for instance. + There are a number of checksum types available including MD5 hashing (and an md5lite variation that only hashes the first 500 characters of the - file." + file. + + The default checksum parameter, if checksums are enabled, is md5." @event = :file_changed @@ -41,11 +43,6 @@ Puppet::Type.type(:file).newproperty(:checksum) do handlesum() end - newvalue(:nosum) do - # nothing - :nochange - end - # If they pass us a sum type, behave normally, but if they pass # us a sum type + sum, stick the sum in the cache. munge do |value| @@ -134,35 +131,6 @@ Puppet::Type.type(:file).newproperty(:checksum) do cache(checktype()) end - # Retrieve the cached sum - def getcachedsum - hash = nil - unless hash = @resource.cached(:checksums) - hash = {} - @resource.cache(:checksums, hash) - end - - sumtype = self.should - - if hash.include?(sumtype) - #self.notice "Found checksum %s for %s" % - # [hash[sumtype] ,@resource[:path]] - sum = hash[sumtype] - - unless sum =~ /^\{\w+\}/ - sum = "{%s}%s" % [sumtype, sum] - end - return sum - elsif hash.empty? - #self.notice "Could not find sum of type %s" % sumtype - return :nosum - else - #self.notice "Found checksum for %s but not of type %s" % - # [@resource[:path],sumtype] - return :nosum - end - end - # Calculate the sum from disk. def getsum(checktype, file = nil) sum = "" |