diff options
| author | Bogdan Dobrelya <bdobrelia@mirantis.com> | 2015-10-21 10:46:51 +0200 |
|---|---|---|
| committer | Bogdan Dobrelya <bdobrelia@mirantis.com> | 2015-10-21 10:46:51 +0200 |
| commit | 6427aaf46b97fca26adda03b0f2b6acb5282f599 (patch) | |
| tree | e6e469efce1fb624dd5c2c1d447c495ec988dcf9 | |
| parent | 9e4e607de3a4f8112fecc1d9a4a1af9c5e1cfd83 (diff) | |
| download | rabbitmq-server-git-6427aaf46b97fca26adda03b0f2b6acb5282f599.tar.gz | |
Fix piped exit codes expectations and count processing
* Fix return code of the get_all_pacemaker_nodes() and
get_alive_pacemaker_nodes_but() to be
not provided as ignored anyway.
* Fix return code expectation of the fetched count attribute
in the check_timeouts().
(Fuel related bug)
Closes-bug: #1506440
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
| -rwxr-xr-x | packaging/common/rabbitmq-server-ha.ocf | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packaging/common/rabbitmq-server-ha.ocf b/packaging/common/rabbitmq-server-ha.ocf index a3ed1e0f3c..6404a7dbd2 100755 --- a/packaging/common/rabbitmq-server-ha.ocf +++ b/packaging/common/rabbitmq-server-ha.ocf @@ -540,7 +540,6 @@ get_running_nodes() { get_all_pacemaker_nodes() { echo `crm_node -l | awk '{print $2}' | grep -v "^$" | sed -e '/(null)/d'` - return $? } # Get alive cluster nodes in visible partition, but the specified one @@ -551,7 +550,6 @@ get_alive_pacemaker_nodes_but() else echo `crm_node -l -p | sed -e "s/${1}//g" | sed -e '/(null)/d'` fi - return $? } check_need_join_to() { @@ -1109,13 +1107,15 @@ check_timeouts() { fi local count - count=`crm_attribute -N $THIS_PCMK_NODE -l reboot --name $crm_attr_name --query 2>/dev/null | awk '{print $3}' | awk -F "=" '{print $2}' | sed -e '/(null)/d'` - if [ $? -ne 0 ]; then + count=`crm_attribute -N $THIS_PCMK_NODE -l reboot --name $crm_attr_name --query 2>/dev/null` + op_rc=$? + if [ $op_rc -ne 0 ]; then # the crm_attribute exited with error. In that case most probably it printed garbage # instead of the number we need. So defensively assume that it is zero. count=0 fi + count=`echo "${count}" | awk '{print $3}' | awk -F "=" '{print $2}' | sed -e '/(null)/d'` count=$((count+1)) # There is a slight chance that this piece of code will be executed twice simultaneously. |
