summaryrefslogtreecommitdiff
path: root/lib/chef/provider/execute.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/provider/execute.rb')
-rw-r--r--lib/chef/provider/execute.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index d5a0bdfa11..0e9acb4028 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -58,8 +58,12 @@ class Chef
shell_out_with_systems_locale!(command, opts)
rescue Mixlib::ShellOut::ShellCommandFailed
if sensitive?
- raise Mixlib::ShellOut::ShellCommandFailed,
- "Command execution failed. STDOUT/STDERR suppressed for sensitive resource"
+ ex = Mixlib::ShellOut::ShellCommandFailed.new("Command execution failed. STDOUT/STDERR suppressed for sensitive resource")
+ # Forcibly hide the exception cause chain here so we don't log the unredacted version
+ def ex.cause
+ nil
+ end
+ raise ex
else
raise
end