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