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