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