Fix variables and if statement

This commit is contained in:
Leseb 2012-09-21 11:44:51 +03:00
parent f9307f759a
commit 464b8ed905

View File

@ -213,9 +213,6 @@ cinder_scheduler_status() {
cinder_scheduler_monitor() {
local rc
local pid
local rc_db
local rc_amqp
local scheduler_db_check
local scheduler_amqp_check
cinder_scheduler_status
@ -228,14 +225,13 @@ cinder_scheduler_monitor() {
# Check the connections according to the PID.
# We are sure to hit the scheduler process and not other Cinder process with the same connection behavior (for example cinder-api)
pid=`cat $OCF_RESKEY_pid`
scheduler_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"`
rc_amqp=$?
if [ $rc_amqp -ne 0 ] || [ $rc_db -ne 0 ]; then
ocf_log err "Cinder Scheduler is not connected to the AMQP server : AMQP connection test returned $rc_amqp"
return $OCF_NOT_RUNNING
fi
rc=$?
if [ $rc -ne 0 ]; then
ocf_log err "Cinder Scheduler is not connected to the AMQP server : $rc"
return $OCF_NOT_RUNNING
fi
ocf_log debug "OpenStack Cinder Scheduler (cinder-schedule) monitor succeeded"
return $OCF_SUCCESS