summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2019-09-21 01:07:30 +0530
committerAravinda VK <avishwan@redhat.com>2019-09-24 04:56:32 +0000
commita4900e490c444cf88b202d6925d3ca3a06ad0355 (patch)
tree598908f0b5e10b0693cc7c74ff4b5be59a2074ad /geo-replication/syncdaemon
parent9fa05e11b802ddd03825bbe54968e0937878f2b7 (diff)
geo-rep : fix sub-command during worker connection
Problem: Geo-rep session for non-root going faulty. Solution: During worker start we do not construct slave url and use 'args.resource_remote' which is basically just slave-hostname. This works better for root session but fails in non-root session during ssh command. Using slave url solves this issue. fixes: bz#1753928 Change-Id: Ib83552fde77f81c208896494b323514ab37ebf22 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon')
-rw-r--r--geo-replication/syncdaemon/subcmds.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/subcmds.py b/geo-replication/syncdaemon/subcmds.py
index 8de7db2cdaa..f8515f2607b 100644
--- a/geo-replication/syncdaemon/subcmds.py
+++ b/geo-replication/syncdaemon/subcmds.py
@@ -73,8 +73,11 @@ def subcmd_worker(args):
Popen.init_errhandler()
fcntl.fcntl(args.feedback_fd, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
local = GLUSTER("localhost", args.master)
- slavevol = args.slave.split("::")[-1]
- slavehost = args.resource_remote
+ slave_url, slavevol = args.slave.split("::")
+ if "@" not in slave_url:
+ slavehost = args.resource_remote
+ else:
+ slavehost = "%s@%s" % (slave_url.split("@")[0], args.resource_remote)
remote = SSH(slavehost, slavevol)
remote.connect_remote()
local.connect()