This is an automated email from the ASF dual-hosted git repository.
olehmykolaishyn pushed a commit to branch DATALAB-2743
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2743 by this push:
new 69c9726 used object_versions for deletion on s3
69c9726 is described below
commit 69c9726f360f38b725e61c33ec37e7840e9f19ae
Author: oleh_mykolaishyn <[email protected]>
AuthorDate: Thu Mar 17 13:05:09 2022 +0200
used object_versions for deletion on s3
---
infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index a6ec29e..434f5fd 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -1143,7 +1143,8 @@ def remove_s3(bucket_type='all', scientist=''):
for s3bucket in bucket_list:
if s3bucket:
bucket = s3.Bucket(s3bucket)
- bucket.objects.all().delete()
+ bucket.object_versions.delete()
+# bucket.objects.all().delete()
print("The S3 bucket {} has been cleaned".format(s3bucket))
client.delete_bucket(Bucket=s3bucket)
print("The S3 bucket {} has been deleted
successfully".format(s3bucket))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]