Skip to content

Commit

Permalink
sweep: #7655 fix SSHCE: clearer error message when output is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr authored and web-flow committed Jun 7, 2024
1 parent 327bb18 commit 6b4aeb8
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 @@ -507,12 +507,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 6b4aeb8

Please sign in to comment.