Skip to content

Commit

Permalink
Merge pull request #7655 from aldbr/v8.0_FIX_sshce-better-exception
Browse files Browse the repository at this point in the history
[8.0] fix SSHCE: clearer error message when output is not found
  • Loading branch information
fstagni committed Jun 7, 2024
2 parents 725cd3a + cf88134 commit d922d22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/DIRAC/Resources/Computing/SSHComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,15 @@ def __executeHostCommand(self, command, options, ssh=None, host=None):
# Examine results of the job submission
if sshStatus == 0:
output = sshStdout.strip().replace("\r", "").strip()
if not output:
return S_ERROR("No output from remote command")

try:
index = output.index("============= Start output ===============")
output = output[index + 42 :]
except Exception:
self.log.exception("Invalid output from remote command", output)
except ValueError:
return S_ERROR(f"Invalid output from remote command: {output}")

try:
output = unquote(output)
result = json.loads(output)
Expand Down

0 comments on commit d922d22

Please sign in to comment.