Blob Blame History Raw
From c5bf1758adf3ea2941fd896bc4a38f0c252c6ba1 Mon Sep 17 00:00:00 2001
From: Jiffin Tony Thottan <jthottan@redhat.com>
Date: Tue, 6 Dec 2016 13:38:21 +0530
Subject: [PATCH 235/235] ganesha/scripts : find export id for already exported
 volume in S31ganesha-start.sh

Upstream reference:
>Change-Id: Iada90ed215966d3f526fa20aa5359b67f25a6944
>BUG: 1401822
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
>Reviewed-on: http://review.gluster.org/16037
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: soumya k <skoduri@redhat.com>
>Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>

Change-Id: Iada90ed215966d3f526fa20aa5359b67f25a6944
BUG: 1401806
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/92556
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 extras/hook-scripts/start/post/S31ganesha-start.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/extras/hook-scripts/start/post/S31ganesha-start.sh b/extras/hook-scripts/start/post/S31ganesha-start.sh
index 0e98ec2..90ba6bc 100755
--- a/extras/hook-scripts/start/post/S31ganesha-start.sh
+++ b/extras/hook-scripts/start/post/S31ganesha-start.sh
@@ -112,6 +112,9 @@ then
                 sed -i s/Export_Id.*/"Export_Id=$EXPORT_ID;"/ \
                         $GANESHA_DIR/exports/export.$VOL.conf
                 echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF1
+        else
+                EXPORT_ID=$(grep ^[[:space:]]*Export_Id $GANESHA_DIR/exports/export.$VOL.conf |\
+                          awk -F"[=,;]" '{print $2}' | tr -d '[[:space:]]')
         fi
         export_add $VOL
 fi
-- 
2.9.3