better logging in __cdist_exec_fail_on_error

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-04-06 20:55:53 +02:00
parent 1f4e8fe564
commit 2162d444b3

View file

@ -187,7 +187,8 @@ __cdist_exec_fail_on_error()
set +e set +e
sh -e "$@" sh -e "$@"
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
__cdist_echo error "$1 exited non-zero, showing code:" __cdist_echo error "$1 exited non-zero"
__cdist_echo info "Faulty code:"
cat "$1" cat "$1"
__cdist_exit_err "Aborting due to non-zero exit code." __cdist_exit_err "Aborting due to non-zero exit code."
fi fi