Skip to content

Commit

Permalink
Merge pull request #7660 from DIRACGridBot/cherry-pick-2-d922d22bf-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] fix SSHCE: clearer error message when output is not found
  • Loading branch information
fstagni authored Jun 9, 2024
2 parents 327bb18 + 6b4aeb8 commit 877f334
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 877f334

Please sign in to comment.