[devops] Updated ssh.upload() to overwrite files
This commit is contained in:
parent
2a80316b04
commit
79f5e81e22
@ -175,8 +175,9 @@ class SSHClient(object):
|
||||
for entry in files:
|
||||
local_path = os.path.join(rootdir, entry)
|
||||
remote_path = os.path.join(targetdir, entry)
|
||||
if not self.exists(remote_path):
|
||||
self._sftp.put(local_path, remote_path)
|
||||
if self.exists(remote_path):
|
||||
self._sftp.unlink(remote_path)
|
||||
self._sftp.put(local_path, remote_path)
|
||||
|
||||
def exists(self, path):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user