Skip to content

Commit

Permalink
fix: remove setup and fix return values
Browse files Browse the repository at this point in the history
  • Loading branch information
martynia committed Aug 15, 2023
1 parent 6de56a4 commit 705f6b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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)
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 705f6b5

Please sign in to comment.