Fix get_monitor function and local vars for rabbit OCF
W/o this fix:
* get_monitor() does not handle the case then rabbit
app is running and reports $OCF_RUNNING. This makes
the resource to stuck in semi-started state for ever.
* get_monitor() does not always record in logs when
sets master score 0 to ensure the slave does not get
promoted. This makes logging patterns not consistent.
* get_monitor() has two exit point for generic error case
instead of one. This makes logging patterns not consistent.
* some variables are missing the local
declaration and might be reused in another places
leading to unpredictable results. For example,
there is the nodelist var should be local as it is
used both action_notify(), get_monitor().
The solution is:
* fix missing local declarations for variables and
remove unused ones as well.
* add missing log record for "ensuring this slave does
not get promoted."
* handle the get_monitor() case when rabbit app is not
running as appropriate and report $OCF_NOT_RUNNING.
* make the single get_monitor() return point for the
$OCF_ERR_GENERIC case.
Reviewed: https:/ /review. openstack. org/184070 /git.openstack. org/cgit/ stackforge/ fuel-library/ commit/ ?id=454a1485453 919756b8a4e3083 fb71b0928158ec
Committed: https:/
Submitter: Jenkins
Branch: master
commit 454a14854539197 56b8a4e3083fb71 b0928158ec
Author: Bogdan Dobrelya <email address hidden>
Date: Mon May 18 16:00:37 2015 +0200
Fix get_monitor function and local vars for rabbit OCF
W/o this fix:
* get_monitor() does not handle the case then rabbit
app is running and reports $OCF_RUNNING. This makes
the resource to stuck in semi-started state for ever.
* get_monitor() does not always record in logs when
sets master score 0 to ensure the slave does not get
promoted. This makes logging patterns not consistent.
* get_monitor() has two exit point for generic error case
instead of one. This makes logging patterns not consistent.
* some variables are missing the local
declaration and might be reused in another places
leading to unpredictable results. For example,
there is the nodelist var should be local as it is
used both action_notify(), get_monitor().
The solution is: ERR_GENERIC case.
* fix missing local declarations for variables and
remove unused ones as well.
* add missing log record for "ensuring this slave does
not get promoted."
* handle the get_monitor() case when rabbit app is not
running as appropriate and report $OCF_NOT_RUNNING.
* make the single get_monitor() return point for the
$OCF_
Closes-bug: #1455761
Change-Id: Iba5e9d984083ac ea1392cad0abd64 53f5d6fbf8b
Signed-off-by: Bogdan Dobrelya <email address hidden>