From 3bba294f40e774da4786a8460400c5ca10c79e72 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Fri, 3 May 2024 13:05:38 -0400 Subject: [PATCH] Fix update command exit code --- lib/foreman_maintain/cli/update_command.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/foreman_maintain/cli/update_command.rb b/lib/foreman_maintain/cli/update_command.rb index 7594ecf15..05f6cbfa5 100644 --- a/lib/foreman_maintain/cli/update_command.rb +++ b/lib/foreman_maintain/cli/update_command.rb @@ -26,8 +26,9 @@ def update_runner def execute ForemanMaintain.validate_downstream_packages ForemanMaintain.perform_self_upgrade unless disable_self_update? - update_runner.run_phase(:pre_update_checks) - exit update_runner.exit_code + runner = update_runner + runner.run_phase(:pre_update_checks) + exit runner.exit_code end end @@ -38,9 +39,10 @@ def execute def execute ForemanMaintain.validate_downstream_packages ForemanMaintain.perform_self_upgrade unless disable_self_update? - update_runner.run - update_runner.save - exit update_runner.exit_code + runner = update_runner + runner.run + runner.save + exit runner.exit_code end end end