233933
From cb9d0fa4bd2664556f0564406037f9fb7fb781a6 Mon Sep 17 00:00:00 2001
233933
From: Kotresh HR <khiremat@redhat.com>
233933
Date: Wed, 31 Jul 2019 15:40:55 +0530
233933
Subject: [PATCH 266/276] geo-rep: Fix mount broker setup issue
233933
233933
Even the use builtin 'type' command as in patch [1]
233933
causes issues if argument in question is not part of PATH
233933
environment variable for that user. This patch fixes the
233933
same by doing source /etc/profile. This was already being
233933
used in another part of script.
233933
233933
[1] https://review.gluster.org/23089
233933
233933
Backport of:
233933
 > Patch: https://review.gluster.org/23136
233933
 > Change-Id: Iceb78835967ec6a4350983eec9af28398410c002
233933
 > fixes: bz#1734738
233933
 > Signed-off-by: Kotresh HR <khiremat@redhat.com>
233933
233933
Change-Id: Iceb78835967ec6a4350983eec9af28398410c002
233933
BUG: 1734734
233933
Signed-off-by: Kotresh HR <khiremat@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/177867
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 geo-replication/src/gverify.sh | 9 ++++++---
233933
 1 file changed, 6 insertions(+), 3 deletions(-)
233933
233933
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh
233933
index 692c1d6..f5f70d2 100755
233933
--- a/geo-replication/src/gverify.sh
233933
+++ b/geo-replication/src/gverify.sh
233933
@@ -180,6 +180,8 @@ function main()
233933
     > $log_file
233933
 
233933
     inet6=$7
233933
+    local cmd_line
233933
+    local ver
233933
 
233933
     # Use FORCE_BLOCKER flag in the error message to differentiate
233933
     # between the errors which the force command should bypass
233933
@@ -206,13 +208,14 @@ function main()
233933
         exit 1;
233933
     fi;
233933
 
233933
+    cmd_line=$(cmd_slave);
233933
     if [[ -z "${GR_SSH_IDENTITY_KEY}" ]]; then
233933
-        ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "type -p gluster"
233933
+        ver=$(ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 bash -c "'$cmd_line'")
233933
     else
233933
-        ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "type -p gluster"
233933
+        ver=$(ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 bash -c "'$cmd_line'")
233933
     fi
233933
 
233933
-    if [ $? -ne 0 ]; then
233933
+    if [ -z "$ver" ]; then
233933
         echo "FORCE_BLOCKER|gluster command not found on $3 for user $2." > $log_file
233933
         exit 1;
233933
     fi;
233933
-- 
233933
1.8.3.1
233933