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