diff --git a/src/DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/FileCacheDownloadPlugin.py b/src/DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/FileCacheDownloadPlugin.py index c8df12cb5bf..c74582829ff 100644 --- a/src/DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/FileCacheDownloadPlugin.py +++ b/src/DIRAC/WorkloadManagementSystem/Client/PilotLoggingPlugins/FileCacheDownloadPlugin.py @@ -23,7 +23,7 @@ def __init__(self): Sets the pilot log files location for a WebServer. """ - self.setup = gConfig.getValue("/DIRAC/Setup", None) + pass def getRemotePilotLogs(self, pilotStamp, vo=None): """ @@ -35,7 +35,7 @@ def getRemotePilotLogs(self, pilotStamp, vo=None): :rtype: dict """ - opsHelper = Operations(vo=vo, setup=self.setup) + opsHelper = Operations(vo=vo) uploadPath = opsHelper.getValue("Pilot/UploadPath", "") lfn = os.path.join(uploadPath, pilotStamp + ".log") sLog.info("LFN to download: ", lfn) @@ -62,7 +62,7 @@ def getRemotePilotLogs(self, pilotStamp, vo=None): return res if lfn in res["Value"]["Failed"]: sLog.error("Failed to retrieve a log file:", res["Value"]["Failed"]) - return res + return S_ERROR(f"Failed to retrieve a log file: {res['Value']['Failed']}") try: filename = os.path.join(filepath, pilotStamp + ".log") with open(filename) as f: diff --git a/src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py index 3848105f73f..abb5bc111b2 100644 --- a/src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py +++ b/src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py @@ -174,7 +174,7 @@ def export_getRemotePilotOutput(self, pilotReference): result = self.pilotAgentsDB.getPilotInfo(pilotReference) if not result["OK"]: self.log.error("Failed to get info for pilot", result["Message"]) - return S_ERROR("Failed to get info for pilot") + return result if not result["Value"]: self.log.warn("The pilot info is empty", pilotReference) return S_ERROR("Pilot info is empty")