Skip to content

Commit d2e64df

Browse files
chaenweb-flow
authored andcommitted
sweep: #7077 fix (ReplicateAndRegister): better error reporting for files with no replicas
1 parent 9484c77 commit d2e64df

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,16 @@ def fts3Transfer(self):
430430
)
431431
opFile.Error = "Couldn't get metadata"
432432
elif noReplicas:
433-
self.log.error(
434-
"Unable to schedule transfer",
435-
f"File {opFile.LFN} doesn't exist at {','.join(noReplicas)}",
436-
)
433+
if None in noReplicas:
434+
self.log.error(
435+
"Unable to schedule transfer",
436+
f"File {opFile.LFN} doesn't have any replicas, which should never happen",
437+
)
438+
else:
439+
self.log.error(
440+
"Unable to schedule transfer",
441+
f"File {opFile.LFN} doesn't exist at {','.join(noReplicas)}",
442+
)
437443
opFile.Error = "No replicas found"
438444
opFile.Status = "Failed"
439445
elif badReplicas:

src/DIRAC/Interfaces/API/Dirac.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,10 @@ def getReplicas(self, lfns, active=True, preferDisk=False, diskOnly=False, print
721721
for lfn in repsResult["Value"]["Failed"]:
722722
records.append((lfn, "Unknown", str(repsResult["Value"]["Failed"][lfn])))
723723

724-
printTable(fields, records, numbering=False)
724+
if records:
725+
printTable(fields, records, numbering=False)
726+
else:
727+
self.log.info("No replicas found")
725728

726729
return repsResult
727730

0 commit comments

Comments
 (0)