NovaEvacuate: Support the new split-out IHA fence agents with backwards compatibility

Change-Id: Ib43294fa1fe3e814d041167aabbfe46140032e24
This commit is contained in:
Andrew Beekhof 2017-09-13 22:43:29 +10:00 committed by Adam Spiers
parent 7d61c3b0b2
commit d46f78fda4
1 changed files with 12 additions and 5 deletions

View File

@ -202,10 +202,15 @@ handle_evacuations() {
esac esac
if [ $need_evacuate = 1 ]; then if [ $need_evacuate = 1 ]; then
found=0 fence_agent="fence_compute"
ocf_log notice "Initiating evacuation of $node"
fence_compute ${fence_options} -o status -n ${node} if have_binary fence_evacuate
then
fence_agent="fence_evacuate"
fi
ocf_log notice "Initiating evacuation of $node with $fence_agent"
$fence_agent ${fence_options} -o status -n ${node}
if [ $? = 1 ]; then if [ $? = 1 ]; then
ocf_log info "Nova does not know about ${node}" ocf_log info "Nova does not know about ${node}"
# Dont mark as no because perhaps nova is unavailable right now # Dont mark as no because perhaps nova is unavailable right now
@ -217,7 +222,7 @@ handle_evacuations() {
return $OCF_SUCCESS return $OCF_SUCCESS
fi fi
fence_compute ${fence_options} -o off -n $node $fence_agent ${fence_options} -o off -n $node
rc=$? rc=$?
if [ $rc = 0 ]; then if [ $rc = 0 ]; then
@ -252,7 +257,9 @@ evacuate_validate() {
rc=$OCF_SUCCESS rc=$OCF_SUCCESS
fence_options="" fence_options=""
check_binary fence_compute if ! have_binary fence_evacuate
check_binary fence_compute
fi
# Is the state directory writable? # Is the state directory writable?
state_dir=$(dirname $statefile) state_dir=$(dirname $statefile)