Skip to content

Commit 1110fb2

Browse files
chore: Remove all getPilotOutput
1 parent 5af196f commit 1110fb2

File tree

2 files changed

+2
-71
lines changed

2 files changed

+2
-71
lines changed

src/DIRAC/Interfaces/API/DiracAdmin.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -380,63 +380,6 @@ def getJobPilotOutput(self, jobID, directory=""):
380380
self.log.always(f"Outputs retrieved in {outputPath}")
381381
return result
382382

383-
#############################################################################
384-
def getPilotOutput(self, gridReference, directory=""):
385-
"""Retrieve the pilot output (std.out and std.err) for an existing pilot reference.
386-
387-
>>> gLogger.notice(dirac.getJobPilotOutput(12345))
388-
{'OK': True, 'Value': {}}
389-
390-
:param str gridReference: pilot reference
391-
:param str directory: a directory to download logs to.
392-
:return: S_OK,S_ERROR
393-
"""
394-
if not isinstance(gridReference, str):
395-
return self._errorReport("Expected string for pilot reference")
396-
397-
if not directory:
398-
directory = self.currentDir
399-
400-
if not os.path.exists(directory):
401-
return self._errorReport(f"Directory {directory} does not exist")
402-
403-
result = PilotManagerClient().getPilotOutput(gridReference)
404-
if not result["OK"]:
405-
return result
406-
407-
gridReferenceSmall = gridReference.split("/")[-1]
408-
if not gridReferenceSmall:
409-
gridReferenceSmall = "reference"
410-
outputPath = f"{directory}/pilot_{gridReferenceSmall}"
411-
412-
if os.path.exists(outputPath):
413-
self.log.info(f"Remove {outputPath} and retry to continue")
414-
return S_ERROR(f"Remove {outputPath} and retry to continue")
415-
416-
if not os.path.exists(outputPath):
417-
self.log.verbose(f"Creating directory {outputPath}")
418-
os.mkdir(outputPath)
419-
420-
outputs = result["Value"]
421-
if "StdOut" in outputs:
422-
stdout = f"{outputPath}/std.out"
423-
with open(stdout, "w") as fopen:
424-
fopen.write(outputs["StdOut"])
425-
self.log.info(f"Standard output written to {stdout}")
426-
else:
427-
self.log.warn("No standard output returned")
428-
429-
if "StdErr" in outputs:
430-
stderr = f"{outputPath}/std.err"
431-
with open(stderr, "w") as fopen:
432-
fopen.write(outputs["StdErr"])
433-
self.log.info(f"Standard error written to {stderr}")
434-
else:
435-
self.log.warn("No standard error returned")
436-
437-
self.log.always(f"Outputs retrieved in {outputPath}")
438-
return result
439-
440383
#############################################################################
441384
def getPilotInfo(self, gridReference):
442385
"""Retrieve info relative to a pilot reference

src/DIRAC/Interfaces/scripts/dirac_admin_get_pilot_output.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@ def main():
2121
_, args = Script.parseCommandLine(ignoreErrors=True)
2222

2323
from DIRAC import exit as DIRACExit
24-
from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin
2524

26-
diracAdmin = DiracAdmin()
27-
exitCode = 0
28-
errorList = []
25+
print("This command is not supported anymore with DIRAV V9.")
2926

30-
for gridID in args:
31-
result = diracAdmin.getPilotOutput(gridID)
32-
if not result["OK"]:
33-
errorList.append((gridID, result["Message"]))
34-
exitCode = 2
35-
36-
for error in errorList:
37-
print("ERROR %s: %s" % error)
38-
39-
DIRACExit(exitCode)
27+
DIRACExit(0)
4028

4129

4230
if __name__ == "__main__":

0 commit comments

Comments
 (0)