File crm-fence-peer-pacemaker2-format.patch of Package drbd-utils.18415

From e59067974db65d70a2df81ca72af6887e10067d1 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Tue, 1 Sep 2020 11:50:52 +0200
Subject: [PATCH] crm-fence-peer.9.sh: fix Pacemaker 2 compat

The text output format of crm_mon changed
(added an asterisk as list item bullet point)

Drop the "start of line" anchor from the regex
which detects whether the partition has quorum.

Also add a missing "unset" when leaving the retry loop early.
---
 scripts/crm-fence-peer.9.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
index 345d4df6..a4f3e9f0 100755
--- a/scripts/crm-fence-peer.9.sh
+++ b/scripts/crm-fence-peer.9.sh
@@ -110,12 +110,13 @@ create_or_modify_constraint()
 		export CIB_file=cib.xml
 
 		set -- $( crm_mon -1nL "$id_prefix-$master_id" | sed -n \
-			-e '/^Current DC:.*partition with quorum/ { s/.*/quorum=1/p };' \
+			-e '/Current DC:.*partition with quorum/ { s/.*/quorum=1/p };' \
 			-e '1,/^Negative Location Constraints:/ d' \
 			-e '/^ *\([^[:space:]]*\)[[:space:]]prevents '"$master_id"' from running.*on '"$HOSTNAME"'$/ { s/.*/already_rejected/p }' )
 
 		if [[ $# != 1 || $1 != "quorum=1" ]] ; then
 			: "sorry, want a quorate partition, and not be rejected by constraint already"
+			unset CIB_file
 			break
 		fi
 
-- 
2.16.4

openSUSE Build Service is sponsored by