Skip to content

Commit

Permalink
sweep: DIRACGrid#7788 SSHComputingElement fix: added check of result
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni authored and web-flow committed Sep 13, 2024
1 parent 5bc53a0 commit a19f8a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/DIRAC/Resources/Computing/SSHComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ def _submitJobToHost(self, executableFile, numberOfJobs, host=None):
return resultCommand

result = resultCommand["Value"]
if not isinstance(result, dict) or "Status" not in result:
return S_ERROR("Invalid result from job submission")
if result["Status"] != 0:
return S_ERROR(f"Failed job submission: {result['Message']}")
else:
Expand Down Expand Up @@ -633,6 +635,8 @@ def _killJobOnHost(self, jobIDList, host=None):
return resultCommand

result = resultCommand["Value"]
if not isinstance(result, dict) or "Status" not in result:
return S_ERROR("Invalid result from job submission")
if result["Status"] != 0:
return S_ERROR(f"Failed job kill: {result['Message']}")

Expand Down Expand Up @@ -668,6 +672,8 @@ def _getHostStatus(self, host=None):
return resultCommand

result = resultCommand["Value"]
if not isinstance(result, dict) or "Status" not in result:
return S_ERROR("Invalid result from job submission")
if result["Status"] != 0:
return S_ERROR(f"Failed to get CE status: {result['Message']}")

Expand All @@ -691,6 +697,8 @@ def _getJobStatusOnHost(self, jobIDList, host=None):
return resultCommand

result = resultCommand["Value"]
if not isinstance(result, dict) or "Status" not in result:
return S_ERROR("Invalid result from job submission")
if result["Status"] != 0:
return S_ERROR(f"Failed to get job status: {result['Message']}")

Expand Down Expand Up @@ -773,6 +781,8 @@ def _getJobOutputFiles(self, jobID):
return resultCommand

result = resultCommand["Value"]
if not isinstance(result, dict) or "Status" not in result:
return S_ERROR("Invalid result from job submission")
if result["Status"] != 0:
return S_ERROR(f"Failed to get job output files: {result['Message']}")

Expand Down

0 comments on commit a19f8a7

Please sign in to comment.