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