1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-26 10:03:37 +03:00

exec_and_log from tm_common.sh exits with last executed command exit code

git-svn-id: http://svn.opennebula.org/one/trunk@773 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Javier Fontán Muiños 2009-08-25 12:37:48 +00:00
parent c28404d469
commit 40645c00fc

View File

@ -62,11 +62,12 @@ function arg_path
function exec_and_log
{
output=`$1 2>&1 1>/dev/null`
if [ "x$?" != "x0" ]; then
code=$?
if [ "x$code" != "x0" ]; then
log_error "Command \"$1\" failed."
log_error "$output"
error_message "$output"
exit -1
exit $code
fi
log "Executed \"$1\"."
}
@ -96,7 +97,7 @@ function timeout_exec_and_log
) &
TIMEOUT_PID=$!
# stopts the exution until the command finalizes
# stops the execution until the command finalizes
wait $CMD_PID 2>/dev/null
CMD_CODE=$?