diff options
Diffstat (limited to 'geo-replication')
-rw-r--r-- | geo-replication/syncdaemon/gsyncd.py | 1 | ||||
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/gsyncd.py b/geo-replication/syncdaemon/gsyncd.py index 982b8532f75..1a812ca8710 100644 --- a/geo-replication/syncdaemon/gsyncd.py +++ b/geo-replication/syncdaemon/gsyncd.py @@ -247,6 +247,7 @@ def main_i(): op.add_option( '--local-path', metavar='PATH', help=SUPPRESS_HELP, default='') op.add_option('-s', '--ssh-command', metavar='CMD', default='ssh') + op.add_option('--ssh-port', metavar='PORT', type=int, default=22) op.add_option('--ssh-command-tar', metavar='CMD', default='ssh') op.add_option('--rsync-command', metavar='CMD', default='rsync') op.add_option('--rsync-options', metavar='OPTS', default='') diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index a44ca914222..2d5ee74e8e1 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -960,6 +960,7 @@ class SlaveRemote(object): tar_cmd = ["tar"] + \ ["-cf", "-", "--files-from", "-"] ssh_cmd = gconf.ssh_command_tar.split() + \ + ["-p", str(gconf.ssh_port)] + \ [host, "tar"] + \ ["--overwrite", "-xf", "-", "-C", rdir] p0 = Popen(tar_cmd, stdout=subprocess.PIPE, @@ -1545,8 +1546,9 @@ class SSH(AbstractUrl, SlaveRemote): self.inner_rsc.url) deferred = go_daemon == 'postconn' - ret = sup(self, gconf.ssh_command.split() + gconf.ssh_ctl_args + - [self.remote_addr], + ret = sup(self, gconf.ssh_command.split() + + ["-p", str(gconf.ssh_port)] + + gconf.ssh_ctl_args + [self.remote_addr], slave=self.inner_rsc.url, deferred=deferred) if deferred: @@ -1570,7 +1572,9 @@ class SSH(AbstractUrl, SlaveRemote): def rsync(self, files): return sup(self, files, '-e', - " ".join(gconf.ssh_command.split() + gconf.ssh_ctl_args), + " ".join(gconf.ssh_command.split() + + ["-p", str(gconf.ssh_port)] + + gconf.ssh_ctl_args), *(gconf.rsync_ssh_options.split() + [self.slaveurl])) def tarssh(self, files): |