Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (FTSAgent): correct condition for return type #7857

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,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 @@ -382,6 +383,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
Loading