Bug/log syncer fails with parentheses (#2653)

* Update rsync command

* Escape rsync locations

* Fix the accidental variable move

* Update rsync to use -s flag
This commit is contained in:
Kristian Hartikainen
2018-10-06 00:34:53 -07:00
committed by Eric Liang
parent ecd8f39580
commit 2d35a97a76
+6 -4
View File
@@ -107,11 +107,13 @@ class _LogSyncer(object):
if not distutils.spawn.find_executable("rsync"):
logger.error("Log sync requires rsync to be installed.")
return
source = '{}@{}:{}/'.format(ssh_user, self.worker_ip,
self.local_dir)
target = '{}/'.format(self.local_dir)
worker_to_local_sync_cmd = ((
"""rsync -avz -e "ssh -i {} -o ConnectTimeout=120s """
"""-o StrictHostKeyChecking=no" '{}@{}:{}/' '{}/'""").format(
quote(ssh_key), ssh_user, self.worker_ip,
quote(self.local_dir), quote(self.local_dir)))
"""rsync -savz -e "ssh -i {} -o ConnectTimeout=120s """
"""-o StrictHostKeyChecking=no" {} {}""").format(
quote(ssh_key), quote(source), quote(target)))
if self.remote_dir:
if self.remote_dir.startswith(S3_PREFIX):