Check if upstream rabbitmq ocf script is installed

This change adds a check to the fuel rabbitmq ocf script to ensure we
are returning the correct return code. Because the rabbitmq cluster
configuration may exist on all nodes prior to the rabbitmq-server
package, we get into a state where the rabbitmq-server script is
partially available. But since we are sourcing the upstream script, when
it fails it returns 1 which is being interpreted as the wrong error.
This change returns not running if the script is not available since
clearly we can't be running if the package is not installed yet.

Change-Id: Idbc2a9ded39a47e06183793ac4a63115f93c9ba6
Closes-Bug: #1599479
This commit is contained in:
Alex Schultz 2016-07-07 14:06:28 -06:00
parent a20098965a
commit f60e93dfe6
1 changed files with 7 additions and 0 deletions

View File

@ -27,4 +27,11 @@ affected by this flag.
EOF
upstream_rabbitmq_ocf_script="${OCF_ROOT}/resource.d/rabbitmq/rabbitmq-server-ha"
# if we haven't installed the upstream script, clearly we cannot be running.
if ! test -f $upstream_rabbitmq_ocf_script ; then
ocf_log err "rabbitmq-server upstream ocf script not present ${upstream_rabbitmq_ocf_script}"
exit $OCF_NOT_RUNNING
fi
. $upstream_rabbitmq_ocf_script