Ticket #511: fix-511.patch
| File fix-511.patch, 1.8 kB (added by DavidS, 1 year ago) |
|---|
-
a/lib/puppet/type/pfile/checksum.rb
old new 161 161 if ! FileTest.file?(@resource[:path]) 162 162 @resource.debug "Cannot MD5 sum %s; using mtime" % 163 163 [@resource.stat.ftype] 164 sum = @resource.stat.mtime. to_s164 sum = @resource.stat.mtime.utc.to_s 165 165 else 166 166 begin 167 167 File.open(@resource[:path]) { |file| … … 186 186 end 187 187 end 188 188 when :timestamp, :mtime: 189 sum = @resource.stat.mtime. to_s190 #sum = File.stat(@resource[:path]).mtime. to_s189 sum = @resource.stat.mtime.utc.to_s 190 #sum = File.stat(@resource[:path]).mtime.utc.to_s 191 191 when :time: 192 sum = @resource.stat.ctime. to_s193 #sum = File.stat(@resource[:path]).ctime. to_s192 sum = @resource.stat.ctime.utc.to_s 193 #sum = File.stat(@resource[:path]).ctime.utc.to_s 194 194 else 195 195 raise Puppet::Error, "Invalid sum type %s" % checktype 196 196 end -
a/test/ral/types/file.rb
old new 434 434 assert(file.property(:checksum).insync?(sum), 435 435 "checksum is not in sync") 436 436 437 assert(/ UTC /.match(sum), 438 "checksum not in UTC timezone, but is '%s'" % sum ) if type =~ /time/ 439 437 440 sleep 1.1 if type =~ /time/ 438 441 assert_nothing_raised() { 439 442 File.unlink(path)