Skip to content

Commit

Permalink
fix(resources): clearer error log in SSHCE if output is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Jun 7, 2024
1 parent 0dc7a25 commit cf88134
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 cf88134

Please sign in to comment.