Commit df3a80b4 authored by Jameson Rollins's avatar Jameson Rollins

guardctrl: better error messages for ssh failures

parent 39190f7d
......@@ -397,7 +397,6 @@ def main_remote():
SSH_CMD = [
'ssh',
'-q',
'-S', '~/.ssh/controls/%r@%h:%p',
'-o', 'ControlMaster=auto',
'-o', 'ControlPersist=600',
......@@ -423,7 +422,15 @@ def main_remote():
args_enc = json.dumps(args)
# launch in foreground
subprocess.call(SSH_CMD + [args_enc])
try:
subprocess.run(
SSH_CMD + [args_enc],
stderr=subprocess.PIPE,
check=True,
)
except subprocess.CalledProcessError as e:
sys.exit("cmd: {}\n{}".format(
' '.join(e.cmd), e.stderr.decode().strip()))
def main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment