Browse Source

neutron-ha-tool: make start action retry

https://github.com/SUSE-Cloud/cookbook-openstack-network/pull/1
adds (amongst many other things) support for neutron-ha-tool to retry
its connections to neutron-server.  By taking advantage of this in
this OCF RA, we can make failover more robust.

Signed-off-by: Adam Spiers <aspiers@suse.com>
Change-Id: I41c37500f691e2e0ecfd6c31f1720f483513e447
Adam Spiers 3 years ago
parent
commit
a0451cbf57
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      ocf/neutron-ha-tool

+ 9
- 2
ocf/neutron-ha-tool View File

@@ -248,7 +248,14 @@ neutron_ha_tool_start() {
248 248
         INSECURE="--insecure"
249 249
     fi
250 250
 
251
-    ${OCF_RESKEY_binary} --replicate-dhcp $INSECURE
251
+    # Remain backwards-compatible with older neutron-ha-tool.py which
252
+    # don't support --retry.
253
+    retry=""
254
+    if ${OCF_RESKEY_binary} --help | grep -q -- --retry; then
255
+        retry="--retry"
256
+    fi
257
+
258
+    ${OCF_RESKEY_binary} --replicate-dhcp $retry $INSECURE
252 259
 
253 260
     rc=$?
254 261
     if [ $rc -ne 0 ]; then
@@ -257,7 +264,7 @@ neutron_ha_tool_start() {
257 264
         return $OCF_ERR_GENERIC
258 265
     fi
259 266
 
260
-    ${OCF_RESKEY_binary} --l3-agent-migrate --now $INSECURE
267
+    ${OCF_RESKEY_binary} --l3-agent-migrate $retry --now $INSECURE
261 268
 
262 269
     rc=$?
263 270
     if [ $rc -ne 0 ]; then

Loading…
Cancel
Save