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