109fe2
From 18572d4e1e84c9d1f293b9a3082190133367154e Mon Sep 17 00:00:00 2001
109fe2
From: Ken Gaillot <kgaillot@redhat.com>
109fe2
Date: Fri, 26 Jan 2018 12:31:09 -0600
109fe2
Subject: [PATCH] Fix: tools: crm_master should always work on node attribute
109fe2
109fe2
Before ccbdb2a, crm_master would always set --node, thus ensuring crm_attribute
109fe2
would treat the value as a node attribute. That commit removed that so that
109fe2
crm_attribute could determine the local node name properly, but that introduced
109fe2
an issue where the master value would be set as a cluster property instead of a
109fe2
node attribute if --lifetime (or --node) was not set explicitly.
109fe2
109fe2
This fixes it by setting the default value of --lifetime explicitly.
109fe2
---
109fe2
 tools/crm_master | 4 ++++
109fe2
 1 file changed, 4 insertions(+)
109fe2
109fe2
diff --git a/tools/crm_master b/tools/crm_master
109fe2
index 7e31cea..f4a0772 100755
109fe2
--- a/tools/crm_master
109fe2
+++ b/tools/crm_master
109fe2
@@ -8,6 +8,10 @@ if [ $? != 0 ] ; then echo "crm_master - A convenience wrapper for crm_attribute
109fe2
 # Note the quotes around `$TEMP': they are essential!
109fe2
 eval set -- "$TEMP"
109fe2
 
109fe2
+# Explicitly set the (usual default) lifetime, so the attribute gets set as a
109fe2
+# node attribute and not a cluster property.
109fe2
+options="--lifetime forever"
109fe2
+
109fe2
 while true ; do
109fe2
 	case "$1" in
109fe2
 	    -N|--node|-U|--uname) options="$options $1 $2"; shift; shift;;
109fe2
-- 
109fe2
1.8.3.1
109fe2