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