Blame SOURCES/bz1836186-pgsql-support-Pacemaker-v2.03-output.patch

5371d1
--- a/heartbeat/ocf-shellfuncs.in	2020-06-16 10:47:54.462276461 +0200
5371d1
+++ b/heartbeat/ocf-shellfuncs.in	2020-06-16 10:43:36.880739016 +0200
5371d1
@@ -563,7 +563,7 @@
5371d1
 # (master/slave) resource. This is defined as a resource where the
5371d1
 # master-max meta attribute is present, and set to greater than zero.
5371d1
 ocf_is_ms() {
5371d1
-    [ ! -z "${OCF_RESKEY_CRM_meta_master_max}" ] && [ "${OCF_RESKEY_CRM_meta_master_max}" -gt 0 ]
5371d1
+    [ "${OCF_RESKEY_CRM_meta_promotable}" = "true" ] || { [ ! -z "${OCF_RESKEY_CRM_meta_master_max}" ] && [ "${OCF_RESKEY_CRM_meta_master_max}" -gt 0 ]; }
5371d1
 }
5371d1
 
5371d1
 # version check functions
5371d1
--- a/heartbeat/pgsql	2020-06-16 10:47:54.474276441 +0200
5371d1
+++ b/heartbeat/pgsql	2020-06-16 10:49:02.835159083 +0200
5371d1
@@ -1021,7 +1021,7 @@
5371d1
 
5371d1
     # I can't get master node name from $OCF_RESKEY_CRM_meta_notify_master_uname on monitor,
5371d1
     # so I will get master node name using crm_mon -n
5371d1
-    print_crm_mon | tr -d "\t" | tr -d " " | grep -q "^${RESOURCE_NAME}[(:].*[):].*Master"
5371d1
+    print_crm_mon | grep -q -i -E "
5371d1
     if [ $? -ne 0 ] ; then
5371d1
         # If I am Slave and Master is not exist
5371d1
         ocf_log info "Master does not exist."
5371d1
@@ -1784,11 +1784,11 @@
5371d1
 }
5371d1
 
5371d1
 is_node_online() {
5371d1
-    print_crm_mon | tr '[A-Z]' '[a-z]' | grep -e "^node $1 " -e "^node $1:" | grep -q -v "offline"
5371d1
+    print_crm_mon | grep -q -i "
5371d1
 }
5371d1
 
5371d1
 node_exist() {
5371d1
-    print_crm_mon | tr '[A-Z]' '[a-z]' | grep -q "^node $1"
5371d1
+    print_crm_mon | grep -q -i "
5371d1
 }
5371d1
 
5371d1
 check_binary2() {
5371d1
@@ -2070,7 +2070,14 @@
5371d1
 
5371d1
 print_crm_mon() {
5371d1
     if [ -z "$CRM_MON_OUTPUT" ]; then
5371d1
-        CRM_MON_OUTPUT=`exec_with_retry 0 crm_mon -n1`
5371d1
+        ocf_version_cmp "$OCF_RESKEY_crm_feature_set" "3.1.0"
5371d1
+        res=$?
5371d1
+        if [ -z "$OCF_RESKEY_crm_feature_set" ] || [ $res -eq 2 ]; then
5371d1
+            XMLOPT="--output-as=xml"
5371d1
+        else
5371d1
+            XMLOPT="--as-xml"
5371d1
+        fi
5371d1
+        CRM_MON_OUTPUT=`exec_with_retry 0 crm_mon -1 $XMLOPT`
5371d1
     fi
5371d1
     printf "${CRM_MON_OUTPUT}\n"
5371d1
 }