Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] SSHComputingElement fix: added check of result #7788

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading