refs #1302 fix ogCalculateChecksum
parent
f66bf4f507
commit
f6ae950201
|
@ -60,11 +60,11 @@ def ogCalculateChecksum (disk=None, par=None, container=None, file=None):
|
||||||
return
|
return
|
||||||
|
|
||||||
last_n_bytes = 1024*1024
|
last_n_bytes = 1024*1024
|
||||||
if last_n_bytes >= os.stat ('/bin/ls').st_size:
|
if last_n_bytes >= os.stat (f).st_size:
|
||||||
return ogCalculateFullChecksum (disk, par, container, file)
|
return ogCalculateFullChecksum (disk, par, container, file)
|
||||||
with open (f, 'rb') as fd:
|
with open (f, 'rb') as fd:
|
||||||
fd.seek (-last_n_bytes, os.SEEK_END)
|
fd.seek (-last_n_bytes, os.SEEK_END)
|
||||||
data = file.read()
|
data = fd.read()
|
||||||
md5 = hashlib.md5(data).hexdigest()
|
md5 = hashlib.md5(data).hexdigest()
|
||||||
|
|
||||||
return md5
|
return md5
|
||||||
|
|
Loading…
Reference in New Issue