Fix upload
This commit is contained in:
parent
04f35d301f
commit
4cedbfd5fc
|
@ -18,11 +18,11 @@ if __name__ == "__main__":
|
|||
try:
|
||||
raw = newfile.read_text()
|
||||
encrypted: str = GPG().encrypt(raw, config.server.theirkey, sign=config.server.ourkey)
|
||||
upfl = BytesIO(encrypted.encode())
|
||||
upfl = BytesIO(encrypted.data)
|
||||
uppath = Path(config.server.inpath) / f"{directory.name}_{newfile.name}.pgp"
|
||||
|
||||
with config.server.get_sftp_client() as sftp:
|
||||
sftp.putfo(upfl, uppath)
|
||||
sftp.putfo(upfl, str(uppath))
|
||||
|
||||
if directory.sourcebackup:
|
||||
newfile.rename(Path(directory.sourcebackup) / newfile.name)
|
||||
|
|
Loading…
Reference in a new issue