-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for md5 checksums if remote uses that #248
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add unit tests for the checksum calculation, have a new option in the config for the tests checksum_type
?
ibridges/util.py
Outdated
memv=memoryview(bytearray(128*1024)) | ||
with open(filepath, 'rb', buffering=0) as file: | ||
for item in iter(lambda : file.readinto(memv), 0): | ||
f_hash.update(memv[:item]) | ||
if checksum_type == "md5": | ||
return f"md5:{f_hash.hexdigest()}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The native iRODS checksum in the iCAT not use the prefix md5:
but just returns the md5sum. So will this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, no then it's not going to work. Can we test md5 checksums on both YoDa and the native iRODS integration test?
ibridges/util.py
Outdated
|
||
""" | ||
remote_check = calc_checksum(remote_path) | ||
local_check = calc_checksum(local_path, checksum_type=remote_check.split(":")[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, now I see. You are introducing the md5:
prefix to unify the code for the two checksum types.
Fixes #245