Skip to content

Commit

Permalink
XRootD::cp upload: use md5 from token request as cksum_preset for xrootd
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansev committed Feb 15, 2024
1 parent 3c454f2 commit 238f6cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alienpy/xrd_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ def XrdCopy(wb, job_list: list, xrd_cp_args: XrdCpArgs, printout: str = '') -> l
if copy_job.isUpload:
cksum_mode = 'source'
cksum_type = 'md5'
cksum_preset = ''
cksum_preset = copy_job.token_request['md5']
else: # for downloads we already have the md5 value, lets use that
cksum_mode = 'target'
cksum_type, cksum_preset = get_hash_meta(copy_job.src)
Expand Down
1 change: 1 addition & 0 deletions alienpy/xrd_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def lfnAccessUrl(wb, lfn: str, local_file: str = '', specs: Union[None, list, st
return {}
access_type = 'write'
size = int(os.stat(local_file).st_size)
# compute here as we will tell xrootd to compare with what was sent
md5sum = md5(local_file)
files_with_default_replicas = ['.sh', '.C', '.jdl', '.xml']
if any(lfn.endswith(ext) for ext in files_with_default_replicas) and size < 1048576 and not specs: # we have a special lfn
Expand Down

0 comments on commit 238f6cc

Please sign in to comment.