Commit e56a4d62 authored by 广宏伟's avatar 广宏伟

Merged in dev (pull request #120)

[Update] 复制时有日志
parents 26f4ef5e 697c8d8f
......@@ -197,8 +197,8 @@ class SFTPVolume(BaseVolume):
continue
src_remote_path = self._remote_path(src_path)
dest_remote_path = self._remote_path(dest_path)
f = self.sftp.open(src_remote_path, mode='r')
try:
f = self.sftp.open(src_remote_path, mode='r')
attr = self.sftp.putfo(f, dest_remote_path)
if cut:
removed.append(self.remove(target))
......
......@@ -426,7 +426,13 @@ class InternalSFTPClient(SFTPServer):
def putfo(self, f, path, callback=None, confirm=True):
client, rpath = self.get_sftp_client_rpath(path)
return client.putfo(f, rpath, callback=callback, confirm=confirm)
success = False
try:
attr = client.putfo(f, rpath, callback=callback, confirm=confirm)
success = True
return attr
finally:
self.create_ftp_log(path, 'Upload', success)
def close(self):
return self.session_ended()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment