From 6452ce3921a85bf0a7d11b0f7249ba24473e9615 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 25 Feb 2025 12:37:36 +0100 Subject: [PATCH] Strip the output of the executed command Consumers of the command runner expect the output not to have any trailing spaces, so let's strip them. Fixes: 34609dfbe5bd00e2908e9876279f2e057bf2898d --- lib/foreman_maintain/utils/command_runner.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/foreman_maintain/utils/command_runner.rb b/lib/foreman_maintain/utils/command_runner.rb index c9871c902..9f97b25d6 100644 --- a/lib/foreman_maintain/utils/command_runner.rb +++ b/lib/foreman_maintain/utils/command_runner.rb @@ -89,6 +89,7 @@ def run_interactively def run_non_interactively @output, @stderr, status = Open3.capture3(@env, full_command, :stdin_data => @stdin) + @output.strip! @exit_status = status.exitstatus end