From fff1d2d74c2078b62cc9c2561330e41a842dc197 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 15 Nov 2023 15:51:33 +0100 Subject: [PATCH] ssh: Print details if running the command fails Change-Id: I87adbdd5fe4eb2709c97ab4c21b414145acf788b Signed-off-by: Sebastian Schuberth Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392915 Reviewed-by: Mike Frysinger Reviewed-by: Tuan Vo Hung Commit-Queue: Josip Sokcevic --- ssh.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ssh.py b/ssh.py index a8242790..54a77304 100644 --- a/ssh.py +++ b/ssh.py @@ -57,8 +57,12 @@ def version(): except FileNotFoundError: print("fatal: ssh not installed", file=sys.stderr) sys.exit(1) - except subprocess.CalledProcessError: - print("fatal: unable to detect ssh version", file=sys.stderr) + except subprocess.CalledProcessError as e: + print( + "fatal: unable to detect ssh version" + f" (code={e.returncode}, output={e.stdout})", + file=sys.stderr, + ) sys.exit(1)