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