Skip to content

Commit

Permalink
Merge pull request #7879 from fstagni/cherry-pick-2-53c67a7db-integra…
Browse files Browse the repository at this point in the history
…tion

[sweep:integration] fix (FTSAgent): correct condition for return type
  • Loading branch information
fstagni authored Nov 6, 2024
2 parents 8d138fc + 3b342a2 commit 47a7a88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,15 @@ def _monitorJobCallback(returnedValue):
:param returnedValue: value returned by the _monitorJob method
(ftsJob, standard dirac return struct)
"""
if not isinstance(returnedValue, tuple) or len(returnedValue) != 2:
if isinstance(returnedValue, tuple) and len(returnedValue) == 2:
ftsJob, res = returnedValue
log = gLogger.getLocalSubLogger(f"_monitorJobCallback/{ftsJob.jobID}")
if not res["OK"]:
log.error("Error updating job status", res)
else:
log.debug("Successfully updated job status")
else:
log = gLogger.getLocalSubLogger("_monitorJobCallback")
log.error("Invalid return value when monitoring job", f"{returnedValue!r}")

def monitorJobsLoop(self):
Expand Down Expand Up @@ -385,6 +386,7 @@ def _treatOperationCallback(returnedValue):
else:
log.debug("Successfully treated operation")
else:
log = gLogger.getLocalSubLogger("_treatOperationCallback")
log.error("Invalid return value when treating operation", f"{returnedValue!r}")

def _treatOperation(self, operation):
Expand Down

0 comments on commit 47a7a88

Please sign in to comment.