if self.conf.unique_md_filenames:
- (csum, outfn) = checksum_and_rename(outfn)
+ (csum, outfn) = checksum_and_rename(outfn, self.conf.sumtype)
sfile = os.path.basename(outfn)
else:
if compress:
result = True
return result
-def checksum_and_rename(fn_path):
+def checksum_and_rename(fn_path, sumtype='sha256'):
"""checksum the file rename the file to contain the checksum as a prefix
return the new filename"""
- csum = misc.checksum('sha256', fn_path)
+ csum = misc.checksum(sumtype, fn_path)
fn = os.path.basename(fn_path)
fndir = os.path.dirname(fn_path)
csum_fn = csum + '-' + fn
open_csum = checksum(self.checksum_type, metadata)
- csum, destmd = checksum_and_rename(destmd)
+ csum, destmd = checksum_and_rename(destmd, self.checksum_type)
base_destmd = os.path.basename(destmd)