From c6ce9159794cd96b4a347b69704c888069380440 Mon Sep 17 00:00:00 2001 From: martynia Date: Tue, 11 Jul 2023 14:54:24 +0200 Subject: [PATCH] feat: add a remote pilot option for getJobPilotOutut calls --- src/DIRAC/Interfaces/API/DiracAdmin.py | 4 +++- .../Service/WMSAdministratorHandler.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/DIRAC/Interfaces/API/DiracAdmin.py b/src/DIRAC/Interfaces/API/DiracAdmin.py index 6c68cb82c25..07fd1ba9119 100755 --- a/src/DIRAC/Interfaces/API/DiracAdmin.py +++ b/src/DIRAC/Interfaces/API/DiracAdmin.py @@ -431,7 +431,7 @@ def resetJob(self, jobID): return result ############################################################################# - def getJobPilotOutput(self, jobID, directory=""): + def getJobPilotOutput(self, jobID, directory="", remote=False): """Retrieve the pilot output for an existing job in the WMS. The output will be retrieved in a local directory unless otherwise specified. @@ -441,6 +441,8 @@ def getJobPilotOutput(self, jobID, directory=""): :param job: JobID :type job: integer or string + :param str directory: a directory to download logs to. + :param bool remote: if True a remote storage is used, otherwise classic CE logs :return: S_OK,S_ERROR """ if not directory: diff --git a/src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py index a7aa4c615dc..b96f8289a7e 100755 --- a/src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py +++ b/src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py @@ -173,11 +173,12 @@ def export_getSiteMaskSummary(cls): ############################################################################## types_getJobPilotOutput = [[str, int]] - def export_getJobPilotOutput(self, jobID): + def export_getJobPilotOutput(self, jobID, remote=False): """Get the pilot job standard output and standard error files for the DIRAC job reference :param str jobID: job ID + :param bool remote: if True a remote storage is used, otherwise classic CE logs :return: S_OK(dict)/S_ERROR() """ @@ -209,7 +210,7 @@ def export_getJobPilotOutput(self, jobID): c = cycle if pilotReference: - return self.pilotManager.getPilotOutput(pilotReference) + return self.pilotManager.getPilotOutput(pilotReference, remote=remote) return S_ERROR("No pilot job reference found") ##############################################################################