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