From faeca7576d1d3832ba7fb69a593a5123f527fc91 Mon Sep 17 00:00:00 2001 From: Sean Klein Date: Fri, 1 Apr 2022 12:38:35 -0400 Subject: [PATCH] Check exit status of ssh commands --- deploy/src/bin/thing-flinger.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy/src/bin/thing-flinger.rs b/deploy/src/bin/thing-flinger.rs index 942e0658725..d8a34741d6d 100644 --- a/deploy/src/bin/thing-flinger.rs +++ b/deploy/src/bin/thing-flinger.rs @@ -555,8 +555,12 @@ fn ssh_exec( .arg(&server.addr) .arg(&remote_cmd); cmd.env("SSH_AUTH_SOCK", auth_sock); - cmd.status() + let exit_status = cmd + .status() .context(format!("Failed to run {} on {}", remote_cmd, server.addr))?; + if !exit_status.success() { + anyhow::bail!("Command failed: {}", exit_status); + } Ok(()) }