Explorar o código

Set pipelined writes

Gabriel Adrian Samfira %!s(int64=8) %!d(string=hai) anos
pai
achega
52e01c4b54
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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()