50dc83
From f65f4739914cf317da7e5eaa3b5a06fe64f338c2 Mon Sep 17 00:00:00 2001
50dc83
From: Sunny Kumar <sunkumar@redhat.com>
50dc83
Date: Sat, 21 Sep 2019 01:07:30 +0530
50dc83
Subject: [PATCH 298/302] geo-rep : fix sub-command during worker connection
50dc83
50dc83
Problem:
50dc83
50dc83
Geo-rep session for non-root going faulty.
50dc83
50dc83
Solution:
50dc83
50dc83
During worker start we do not construct slave url and use 'args.resource_remote'
50dc83
which is basically just slave-hostname.
50dc83
This works better for root session but fails in non-root session during
50dc83
ssh command.
50dc83
Using slave url solves this issue.
50dc83
50dc83
Backport of:
50dc83
    >fixes: bz#1753928
50dc83
    >Change-Id: Ib83552fde77f81c208896494b323514ab37ebf22
50dc83
    >Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
50dc83
50dc83
Upstream patch:
50dc83
    https://review.gluster.org/#/c/glusterfs/+/23465/
50dc83
50dc83
BUG: 1754407
50dc83
Change-Id: Ib83552fde77f81c208896494b323514ab37ebf22
50dc83
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
50dc83
Reviewed-on: https://code.engineering.redhat.com/gerrit/181895
50dc83
Tested-by: RHGS Build Bot <nigelb@redhat.com>
50dc83
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
50dc83
---
50dc83
 geo-replication/syncdaemon/subcmds.py | 7 +++++--
50dc83
 1 file changed, 5 insertions(+), 2 deletions(-)
50dc83
50dc83
diff --git a/geo-replication/syncdaemon/subcmds.py b/geo-replication/syncdaemon/subcmds.py
50dc83
index 8de7db2..f8515f2 100644
50dc83
--- a/geo-replication/syncdaemon/subcmds.py
50dc83
+++ b/geo-replication/syncdaemon/subcmds.py
50dc83
@@ -73,8 +73,11 @@ def subcmd_worker(args):
50dc83
     Popen.init_errhandler()
50dc83
     fcntl.fcntl(args.feedback_fd, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
50dc83
     local = GLUSTER("localhost", args.master)
50dc83
-    slavevol = args.slave.split("::")[-1]
50dc83
-    slavehost = args.resource_remote
50dc83
+    slave_url, slavevol = args.slave.split("::")
50dc83
+    if "@" not in slave_url:
50dc83
+        slavehost = args.resource_remote
50dc83
+    else:
50dc83
+        slavehost = "%s@%s" % (slave_url.split("@")[0], args.resource_remote)
50dc83
     remote = SSH(slavehost, slavevol)
50dc83
     remote.connect_remote()
50dc83
     local.connect()
50dc83
-- 
50dc83
1.8.3.1
50dc83