Skip to content
Snippets Groups Projects

Consolidate check on xrdcp 'failure' because file is existing

Merged Gerardo Ganis requested to merge fix-xrdcp into master
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -72,7 +72,10 @@ def copy_to_eos(from_mask, to, dryrun):
try:
subprocess.check_output(shlex.split(command), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
if e.returncode == 54:
eossrv = to.rsplit('//', 1)[0]
eosfnm = '/' + to.rsplit('//', 1)[1] + os.path.basename(from_file)
rc = subprocess.run(['xrdfs', eossrv, 'ls', '-1', eosfnm])
if rc.returncode == 0:
print("\t[EXISTS]")
break
else:
Loading