From fd2af09fd6ff6d57a0e64d64bb93146d54ddaa4b Mon Sep 17 00:00:00 2001 From: Victor Moene Date: Thu, 9 Jan 2025 13:44:45 +0100 Subject: [PATCH] Fixed error handling in deploy Ticket: CFE-4480 Signed-off-by: Victor Moene --- cf_remote/remote.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cf_remote/remote.py b/cf_remote/remote.py index 51c413b..e049bff 100644 --- a/cf_remote/remote.py +++ b/cf_remote/remote.py @@ -620,6 +620,10 @@ def deploy_masterfiles(host, tarball, *, connection=None): ] combined = " && ".join(commands) print("Running: '%s'" % combined) - ssh_sudo(connection, combined) + result = ssh_sudo(connection, combined, errors=True) + + if result is None: + log.error("Command failed, policy failed to deploy") + return 1 print("Policy set successfully deployed to '%s' 🚀" % host) return 0