diff options
Diffstat (limited to 'lib/chef/provider/package/windows/exe.rb')
-rw-r--r-- | lib/chef/provider/package/windows/exe.rb | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/lib/chef/provider/package/windows/exe.rb b/lib/chef/provider/package/windows/exe.rb index a32c207596..e43cd02b08 100644 --- a/lib/chef/provider/package/windows/exe.rb +++ b/lib/chef/provider/package/windows/exe.rb @@ -55,27 +55,17 @@ class Chef def install_package logger.trace("#{new_resource} installing #{new_resource.installer_type} package '#{new_resource.source}'") - begin - shell_out!( - [ - "start", - "\"\"", - "/wait", - "\"#{new_resource.source}\"", - unattended_flags, - expand_options(new_resource.options), - "& exit %%%%ERRORLEVEL%%%%", - ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns - ) - rescue Mixlib::ShellOut::ShellCommandFailed - if sensitive? - ex = Mixlib::ShellOut::ShellCommandFailed.new("Command execution failed. STDOUT/STDERR suppressed for sensitive resource") - raise ex - else - raise - end - end - logger.info("#{new_resource} ran successfully") + shell_out!( + [ + "start", + "\"\"", + "/wait", + "\"#{new_resource.source}\"", + unattended_flags, + expand_options(new_resource.options), + "& exit %%%%ERRORLEVEL%%%%", + ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns, sensitive: new_resource.sensitive + ) end def remove_package @@ -89,10 +79,6 @@ class Chef private - def sensitive? - !!new_resource.sensitive - end - def uninstall_command(uninstall_string) uninstall_string = "\"#{uninstall_string}\"" if ::File.exist?(uninstall_string) uninstall_string = [ |