From 1d0dfdecbddac1fbe978dd84a6d0d58700dd20b0 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Fri, 29 Dec 2023 17:33:11 +0100 Subject: [PATCH] Ensure local exec errs have a meaningful error output --- salt/client/ssh/wrapper/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/client/ssh/wrapper/__init__.py b/salt/client/ssh/wrapper/__init__.py index 082ad5bb8800..051216d213ac 100644 --- a/salt/client/ssh/wrapper/__init__.py +++ b/salt/client/ssh/wrapper/__init__.py @@ -88,7 +88,10 @@ def to_ret(self): return super().to_ret() def __str__(self): - return f"{self._error}: {self.stderr or self.stdout}" + ret = self.to_ret() + if not isinstance(ret, str): + ret = self.stderr or self.stdout + return f"{self._error}: {ret}" class SSHPermissionDeniedError(SSHException):