From a14849ca734fd1c78d5b95fe42924c3268aa49a5 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Tue, 29 Oct 2024 09:56:21 +0100 Subject: [PATCH] fix (FTSAgent): correct condition for return type --- src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py b/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py index 38d4b53a486..97e2445e5df 100644 --- a/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py +++ b/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py @@ -288,7 +288,7 @@ 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"]: @@ -296,6 +296,7 @@ def _monitorJobCallback(returnedValue): 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): @@ -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):