Просмотр исходного кода

Merged in gabriel-samfira/coriolis-core/set-pipelined-writes (pull request #110)

Set pipelined writes

Approved-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
Gabriel-Adrian Samfira 8 лет назад
Родитель
Сommit
25bd6ffed7
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      coriolis/utils.py

+ 4 - 1
coriolis/utils.py

@@ -154,7 +154,10 @@ def read_ssh_file(ssh, remote_path):
 @retry_on_error()
 def write_ssh_file(ssh, remote_path, content):
     sftp = ssh.open_sftp()
-    sftp.open(remote_path, 'wb').write(content)
+    fd = sftp.open(remote_path, 'wb')
+    fd.set_pipelined(True)
+    fd.write(content)
+    fd.close()
 
 
 @retry_on_error()