From bade8e82064668893a21c1a2f90a7b4d6da03af9 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Mon, 26 Jun 2023 13:08:57 +0200 Subject: [PATCH] Fix SSHCommandExecutionError string casting output It should include the specific error, not just the general one --- salt/client/ssh/wrapper/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/client/ssh/wrapper/__init__.py b/salt/client/ssh/wrapper/__init__.py index ff47f19bfbe..5cd337069ca 100644 --- a/salt/client/ssh/wrapper/__init__.py +++ b/salt/client/ssh/wrapper/__init__.py @@ -90,6 +90,12 @@ class SSHCommandExecutionError(SSHException, CommandExecutionError): return self.stderr return super().to_ret() + def __str__(self): + ret = self.to_ret() + if isinstance(ret, str): + return f"{self._error}: {ret}" + return self._error + class SSHPermissionDeniedError(SSHException): """