summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Williams <nath.e.will@gmail.com>2017-07-23 22:10:59 -0700
committerNathan Williams <nath.e.will@gmail.com>2017-07-23 22:14:33 -0700
commitfeff35cc355bd3512f1590191e1a5cef9d8e7736 (patch)
tree398514ca9108947caf27431b02f3d29c0b388cd0
parent20e69231e1bdb153529e19425599b145dd800ffd (diff)
downloadchef-feff35cc355bd3512f1590191e1a5cef9d8e7736.tar.gz
surface guard interpreter errors for debugging
Signed-off-by: Nathan Williams <nath.e.will@gmail.com>
-rw-r--r--lib/chef/guard_interpreter/default_guard_interpreter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/guard_interpreter/default_guard_interpreter.rb b/lib/chef/guard_interpreter/default_guard_interpreter.rb
index f93c0e04f0..52dc803858 100644
--- a/lib/chef/guard_interpreter/default_guard_interpreter.rb
+++ b/lib/chef/guard_interpreter/default_guard_interpreter.rb
@@ -33,7 +33,9 @@ class Chef
public
def evaluate
- shell_out_with_systems_locale(@command, @command_opts).status.success?
+ result = shell_out_with_systems_locale(@command, @command_opts)
+ Chef::Log.debug "Command failed: #{result.stderr}" unless result.status.success?
+ result.status.success?
# Timeout fails command rather than chef-client run, see:
# https://tickets.opscode.com/browse/CHEF-2690
rescue Chef::Exceptions::CommandTimeout