From 6b4aeb80ebcfdffb439e0b055670cb170f2c240b Mon Sep 17 00:00:00 2001 From: aldbr Date: Fri, 7 Jun 2024 18:18:13 +0200 Subject: [PATCH] sweep: #7655 fix SSHCE: clearer error message when output is not found --- src/DIRAC/Resources/Computing/SSHComputingElement.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/Resources/Computing/SSHComputingElement.py b/src/DIRAC/Resources/Computing/SSHComputingElement.py index b157a0d6e87..81b8b7df6bd 100644 --- a/src/DIRAC/Resources/Computing/SSHComputingElement.py +++ b/src/DIRAC/Resources/Computing/SSHComputingElement.py @@ -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)