summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/subcmds.py
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2019-09-21 01:07:30 +0530
committerRinku Kothiya <rkothiya@redhat.com>2019-09-25 11:31:54 +0000
commit6b3fec37931cbf3f7995b119e5a14702d5226772 (patch)
tree96374b9e808246bb58e8f0d673350d3dd1673e0c /geo-replication/syncdaemon/subcmds.py
parent284ecd3ecbfbcc9e7791bacc6305807eb2805fff (diff)
geo-rep : fix sub-command during worker connectionv7.0rc2
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. Backport of: > Patch: https://review.gluster.org/23465 > BUG: 1753928 > Change-Id: Ib83552fde77f81c208896494b323514ab37ebf22 > Signed-off-by: Sunny Kumar <sunkumar@redhat.com> fixes: bz#1755213 Change-Id: Ib83552fde77f81c208896494b323514ab37ebf22 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/subcmds.py')
-rw-r--r--geo-replication/syncdaemon/subcmds.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/subcmds.py b/geo-replication/syncdaemon/subcmds.py
index 4ece7e0..f8515f2 100644
--- a/geo-replication/syncdaemon/subcmds.py
+++ b/geo-replication/syncdaemon/subcmds.py
@@ -73,7 +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)
- slavehost, slavevol = args.slave.split("::")
+ 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()