cb8e9e
From c506658cf9ee9f00c1523190208e4fa77ea8b4b3 Mon Sep 17 00:00:00 2001
cb8e9e
From: Kaleb S. KEITHLEY <kkeithle@redhat.com>
cb8e9e
Date: Mon, 15 Jun 2015 15:48:33 -0400
cb8e9e
Subject: [PATCH 083/101] common-ha: cluster HA setup sometimes fails
cb8e9e
cb8e9e
the "s in the VIP_foo="x.x.x.x" lines are problematic now that the
cb8e9e
config file isn't sourced.
cb8e9e
cb8e9e
(A short term work-around is to simply eliminate them.)
cb8e9e
cb8e9e
Change-Id: I3bd814abbf0e957af11bb4d9a3241445ab7b5ed6
cb8e9e
BUG: 1227311
cb8e9e
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/50770
cb8e9e
Reviewed-by: Niels de Vos <ndevos@redhat.com>
cb8e9e
Tested-by: Niels de Vos <ndevos@redhat.com>
cb8e9e
---
cb8e9e
 extras/ganesha/scripts/ganesha-ha.sh |   12 +++++++++---
cb8e9e
 1 files changed, 9 insertions(+), 3 deletions(-)
cb8e9e
cb8e9e
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
cb8e9e
index 9d73cf9..7c7e9c5 100755
cb8e9e
--- a/extras/ganesha/scripts/ganesha-ha.sh
cb8e9e
+++ b/extras/ganesha/scripts/ganesha-ha.sh
cb8e9e
@@ -343,11 +343,14 @@ setup_create_resources()
cb8e9e
 
cb8e9e
     while [[ ${1} ]]; do
cb8e9e
 
cb8e9e
-        ipaddr=$(grep "^VIP_${1}=" ${HA_CONFDIR}/ganesha-ha.conf | cut -d = -f 2)
cb8e9e
+        name="VIP_${1}"
cb8e9e
+        nvs=$(grep "^${name}=" ${HA_CONFDIR}/ganesha-ha.conf)
cb8e9e
+        eval ${nvs}
cb8e9e
+        eval ipaddr=\$$name
cb8e9e
 
cb8e9e
         pcs -f ${cibfile} resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} cidr_netmask=32 op monitor interval=15s
cb8e9e
         if [ $? -ne 0 ]; then
cb8e9e
-            logger "warning pcs resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} cidr_netmask=32 op monitor interval=10s failed"
cb8e9e
+            logger "warning pcs resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} cidr_netmask=32 op monitor interval=15s failed"
cb8e9e
         fi
cb8e9e
 
cb8e9e
         pcs -f ${cibfile} resource create ${1}-trigger_ip-1 ocf:heartbeat:Dummy
cb8e9e
@@ -437,7 +440,10 @@ recreate_resources()
cb8e9e
     local cibfile=${1}; shift
cb8e9e
 
cb8e9e
     while [[ ${1} ]]; do
cb8e9e
-        ipaddr=$(grep "VIP_${1}=" ${HA_CONFDIR}/ganesha-ha.conf | cut -d = -f 2)
cb8e9e
+        name="VIP_${1}"
cb8e9e
+        nvs=$(grep "^${name}=" ${HA_CONFDIR}/ganesha-ha.conf)
cb8e9e
+        eval ${nvs}
cb8e9e
+        eval ipaddr=\$$name
cb8e9e
 
cb8e9e
         pcs -f ${cibfile} resource create ${1}-cluster_ip-1 ocf:heartbeat:IPaddr ip=${ipaddr} cidr_netmask=32 op monitor interval=15s
cb8e9e
         if [ $? -ne 0 ]; then
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e