diff options
author | David Timber <dxdt@dev.snart.me> | 2022-09-18 13:08:43 +0800 |
---|---|---|
committer | David Timber <dxdt@dev.snart.me> | 2022-09-18 13:08:43 +0800 |
commit | eb485502b7941b486358c3cdabefdaefeff7843e (patch) | |
tree | 245daa2ee677e7d9a9dacc6c4a86ab40f7e947a6 /src/palhm/mod/aws.py | |
parent | decf814739a83cb30dff49c89de5152178052c02 (diff) |
Fix bugs in AWS mod ...
- Fix broken rollback() func
- Use copy() instead of copy_object(), which won't accept files larger
than 50GB
Diffstat (limited to 'src/palhm/mod/aws.py')
-rw-r--r-- | src/palhm/mod/aws.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/palhm/mod/aws.py b/src/palhm/mod/aws.py index 74a0ea4..725861d 100644 --- a/src/palhm/mod/aws.py +++ b/src/palhm/mod/aws.py @@ -197,7 +197,7 @@ class S3BackupBackend (BackupBackend): def rollback (self, ctx: GlobalContext): if not self.cur_backup_uri is None: - self._rm_fs_recursive(ctx, [self.cur_backup_uri]) + self._rm_fs_recursive(ctx, [self.cur_backup_key]) def close (self, ctx: GlobalContext): self._cleanup_multiparts(ctx) @@ -226,12 +226,12 @@ class S3BackupBackend (BackupBackend): if self.sc_rot and self.sc_rot != self.sc_sink: def chsc (k): - self.client.copy_object( - Bucket = self.bucket, - CopySource = mks3objkey([self.bucket, k]), - Key = k, - MetadataDirective = "COPY", - StorageClass = self.sc_rot) + cp_src = { + "Bucket": self.bucket, + "Key": k + } + extra = { "StorageClass": self.sc_rot } + self.client.copy(cp_src, self.bucket, k, extra) with ThreadPoolExecutor(max_workers = ctx.nb_workers) as th_pool: l = self._logger(ctx) |