From 8383629f142341efd346706f738d1443bee1b657 Mon Sep 17 00:00:00 2001 From: Stefano Belforte Date: Mon, 13 May 2024 19:43:07 +0200 Subject: [PATCH] check gfal-copy exit status first. Fix #5310 (#5311) --- src/python/CRABClient/Commands/remote_copy.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/python/CRABClient/Commands/remote_copy.py b/src/python/CRABClient/Commands/remote_copy.py index 9226a993..cfbac7d2 100644 --- a/src/python/CRABClient/Commands/remote_copy.py +++ b/src/python/CRABClient/Commands/remote_copy.py @@ -296,12 +296,13 @@ def processWorker(self, input_, successfiles, failedfiles): logger.debug("Finish executing for file %s" % fileid) - if returncode != 0 or len(error) > 0: + if returncode != 0: logger.info("%sWarning%s: Failed retrieving %s" % (colors.RED, colors.NORMAL, fileid)) #logger.debug(colors.RED +"Stderr: %s " %stderr+ colors.NORMAL) - for x in error: - logger.info(colors.RED +"\t %s" % x + colors.NORMAL) - failedfiles[fileid] = str(error) + if len(error) > 0: + for x in error: + logger.info(colors.RED +"\t %s" % x + colors.NORMAL) + failedfiles[fileid] = str(error) logger.debug("Full stderr follows:\n%s" % stderr) if "timed out" in stderr or "timed out" in stdout: