Skip to content

Commit

Permalink
Merge pull request #7788 from fstagni/80_sshCE_result_test
Browse files Browse the repository at this point in the history
[8.0] SSHComputingElement fix: added check of result
  • Loading branch information
fstagni authored Sep 13, 2024
2 parents 93ad940 + c42ff89 commit 062a670
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 @@ -597,6 +597,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 @@ -639,6 +641,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 @@ -674,6 +678,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 @@ -697,6 +703,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 @@ -779,6 +787,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 062a670

Please sign in to comment.