Browse Source

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

Change-Id: Ib43294fa1fe3e814d041167aabbfe46140032e24
Andrew Beekhof 1 year ago
parent
commit
d46f78fda4
1 changed files with 12 additions and 5 deletions
  1. 12
    5
      ocf/NovaEvacuate

+ 12
- 5
ocf/NovaEvacuate View File

@@ -202,10 +202,15 @@ handle_evacuations() {
202 202
         esac
203 203
 
204 204
         if [ $need_evacuate = 1 ]; then
205
-            found=0
206
-            ocf_log notice "Initiating evacuation of $node"
205
+            fence_agent="fence_compute"
207 206
 
208
-            fence_compute ${fence_options} -o status -n ${node}
207
+            if have_binary fence_evacuate
208
+            then
209
+                fence_agent="fence_evacuate"
210
+            fi
211
+
212
+            ocf_log notice "Initiating evacuation of $node with $fence_agent"
213
+            $fence_agent ${fence_options} -o status -n ${node}
209 214
             if [ $? = 1 ]; then
210 215
                 ocf_log info "Nova does not know about ${node}"
211 216
                 # Dont mark as no because perhaps nova is unavailable right now
@@ -217,7 +222,7 @@ handle_evacuations() {
217 222
                 return $OCF_SUCCESS
218 223
             fi
219 224
 
220
-            fence_compute ${fence_options} -o off -n $node
225
+            $fence_agent ${fence_options} -o off -n $node
221 226
             rc=$?
222 227
 
223 228
             if [ $rc = 0 ]; then
@@ -252,7 +257,9 @@ evacuate_validate() {
252 257
     rc=$OCF_SUCCESS
253 258
     fence_options=""
254 259
 
255
-    check_binary fence_compute
260
+    if ! have_binary fence_evacuate
261
+       check_binary fence_compute
262
+    fi
256 263
 
257 264
     # Is the state directory writable?
258 265
     state_dir=$(dirname $statefile)

Loading…
Cancel
Save