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