Blame SOURCES/bz1899551-NovaEvacuate-fix-delay_evacuate-unset.patch

184fb6
From 11ac2db8f55aa3e6858d6c1b2ab29ee36b612f03 Mon Sep 17 00:00:00 2001
184fb6
From: Michele Baldessari <michele@acksyn.org>
184fb6
Date: Tue, 17 Nov 2020 15:16:29 +0100
184fb6
Subject: [PATCH] Fix delay_evacuate being unset
184fb6
184fb6
In Ie2fe784202d754eda38092479b1ab3ff4d02136a we added an additional
184fb6
parameter to allow for setting a delay on the evacuation.
184fb6
While it was tested with a specific delay, the case with a delay
184fb6
being unset was missed.
184fb6
Since OCF does not set the defaults from the metadata specification
184fb6
for a parameter, we need to manually set it ourselves.
184fb6
184fb6
This fixes the following error:
184fb6
Nov 17 13:00:21 database-1.foo.local pacemaker-execd     [185805] (log_op_output)    notice: nova-evacuate_monitor_10000[1038417] error output [ /usr/lib/ocf/resource.d/openstack/NovaEvacuate: line 228: [: !=: unary operator expected ]
184fb6
184fb6
Change-Id: I0b7aacd67b77bc44c67fe7da4c494807abbbb4f3
184fb6
---
184fb6
184fb6
diff --git a/heartbeat/NovaEvacuate b/heartbeat/NovaEvacuate
184fb6
index 596f520..8aa778c 100644
184fb6
--- a/heartbeat/NovaEvacuate
184fb6
+++ b/heartbeat/NovaEvacuate
184fb6
@@ -359,6 +359,10 @@
184fb6
         fence_options="${fence_options} -e ${OCF_RESKEY_endpoint_type}"
184fb6
     fi
184fb6
 
184fb6
+    if [ -z "${OCF_RESKEY_evacuate_delay}" ]; then
184fb6
+        OCF_RESKEY_evacuate_delay=0
184fb6
+    fi
184fb6
+
184fb6
     if [ $rc != $OCF_SUCCESS ]; then
184fb6
         exit $rc
184fb6
     fi