From b6108ba55e99ee35810b4ed9386a08e483261e28 Mon Sep 17 00:00:00 2001 From: Roland Moriz Date: Sun, 22 Dec 2024 02:40:08 +0100 Subject: [PATCH] convert to shell_out(), fixes #116 Signed-off-by: Roland Moriz --- providers/default.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/providers/default.rb b/providers/default.rb index e80ec10..1dc4853 100644 --- a/providers/default.rb +++ b/providers/default.rb @@ -660,9 +660,8 @@ def execute_install_script(install_script) action :nothing end.run_action(:run) else - upgrade_command = Mixlib::ShellOut.new(install_script, timeout: new_resource.install_timeout) - upgrade_command.run_command - if upgrade_command.exitstatus != 0 + upgrade_command = shell_out(install_script, timeout: new_resource.install_timeout) + if upgrade_command.error? raise "Error updating #{chef_infra_product_name}. exit code: #{upgrade_command.exitstatus}.\nSTDERR: #{upgrade_command.stderr}\nSTDOUT: #{upgrade_command.stdout}" end end