Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def rsync(self, files, log_err=False):
return sup(self, files, '-e',
" ".join(gconf.ssh_command.split() +
["-p", str(gconf.ssh_port)] +
gconf.ssh_ctl_args),
*(gconf.rsync_ssh_options.split() + [self.slaveurl]),
log_err=log_err)
is taken apart to two parts, this method is ivoked
once pre-daemon, once post-daemon. Use @go_daemon
to deiced what part to perform.
[NB. ATM gluster product does not makes use of interactive
authentication.]
"""
if go_daemon == 'done':
return self.start_fd_client(*self.fd_pair)
syncdutils.setup_ssh_ctl(tempfile.mkdtemp(prefix='gsyncd-aux-ssh-'),
self.remote_addr,
self.inner_rsc.url)
deferred = go_daemon == 'postconn'
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:
# send a message to peer so that we can wait for
# the answer from which we know connection is
# established and we can proceed with daemonization
# (doing that too early robs the ssh passwd prompt...)
# However, we'd better not start the RepceClient
# before daemonization (that's not preserved properly
# in daemon), we just do a an ad-hoc linear put/get.
i, o = ret
inf = os.fdopen(i)
repce.send(o, None, '__repce_version__')
select((inf,), (), ())