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