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

bcdf71
From 11ac2db8f55aa3e6858d6c1b2ab29ee36b612f03 Mon Sep 17 00:00:00 2001
bcdf71
From: Michele Baldessari <michele@acksyn.org>
bcdf71
Date: Tue, 17 Nov 2020 15:16:29 +0100
bcdf71
Subject: [PATCH] Fix delay_evacuate being unset
bcdf71
bcdf71
In Ie2fe784202d754eda38092479b1ab3ff4d02136a we added an additional
bcdf71
parameter to allow for setting a delay on the evacuation.
bcdf71
While it was tested with a specific delay, the case with a delay
bcdf71
being unset was missed.
bcdf71
Since OCF does not set the defaults from the metadata specification
bcdf71
for a parameter, we need to manually set it ourselves.
bcdf71
bcdf71
This fixes the following error:
bcdf71
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 ]
bcdf71
bcdf71
Change-Id: I0b7aacd67b77bc44c67fe7da4c494807abbbb4f3
bcdf71
---
bcdf71
bcdf71
diff --git a/heartbeat/NovaEvacuate b/heartbeat/NovaEvacuate
bcdf71
index 596f520..8aa778c 100644
bcdf71
--- a/heartbeat/NovaEvacuate
bcdf71
+++ b/heartbeat/NovaEvacuate
bcdf71
@@ -359,6 +359,10 @@
bcdf71
         fence_options="${fence_options} -e ${OCF_RESKEY_endpoint_type}"
bcdf71
     fi
bcdf71
 
bcdf71
+    if [ -z "${OCF_RESKEY_evacuate_delay}" ]; then
bcdf71
+        OCF_RESKEY_evacuate_delay=0
bcdf71
+    fi
bcdf71
+
bcdf71
     if [ $rc != $OCF_SUCCESS ]; then
bcdf71
         exit $rc
bcdf71
     fi