mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-25 02:50:08 +03:00
parent
697fd4e3f8
commit
2420cf3aa7
@ -358,7 +358,9 @@ EOF`
|
||||
fi
|
||||
}
|
||||
|
||||
#This function executes $2 at $1 host and returns stdout
|
||||
# This function executes $2 at $1 host and returns stdout
|
||||
# If $3 is present, it is used as the error message when
|
||||
# the command fails
|
||||
function ssh_monitor_and_log
|
||||
{
|
||||
SSH_EXEC_OUT=`$SSH $1 sh -s 2>/dev/null <<EOF
|
||||
@ -369,8 +371,12 @@ EOF`
|
||||
SSH_EXEC_RC=$?
|
||||
|
||||
if [ $SSH_EXEC_RC -ne 0 ]; then
|
||||
log_error "Command \"$2\" failed: $SSH_EXEC_OUT"
|
||||
error_message "Cannot monitor $1"
|
||||
|
||||
if [ -n "$3" ]; then
|
||||
log_error "Command \"$3\" failed: $SSH_EXEC_OUT"
|
||||
else
|
||||
log_error "Command \"$2\" failed: $SSH_EXEC_OUT"
|
||||
fi
|
||||
|
||||
exit $SSH_EXEC_RC
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user