From d28f3cdc286603e043de882040b61c33935cde77 Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Fri, 4 Aug 2023 14:19:49 +0300 Subject: [PATCH] Add UNDEFINED versionins status Signed-off-by: Andrey Berezin --- src/frostfs_testlib/s3/interfaces.py | 1 + src/frostfs_testlib/steps/s3/s3_helper.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/frostfs_testlib/s3/interfaces.py b/src/frostfs_testlib/s3/interfaces.py index 8d82f71..2b6be7d 100644 --- a/src/frostfs_testlib/s3/interfaces.py +++ b/src/frostfs_testlib/s3/interfaces.py @@ -15,6 +15,7 @@ def _make_objs_dict(key_names): class VersioningStatus(HumanReadableEnum): + UNDEFINED = None ENABLED = "Enabled" SUSPENDED = "Suspended" diff --git a/src/frostfs_testlib/steps/s3/s3_helper.py b/src/frostfs_testlib/steps/s3/s3_helper.py index ae27124..4b900eb 100644 --- a/src/frostfs_testlib/steps/s3/s3_helper.py +++ b/src/frostfs_testlib/steps/s3/s3_helper.py @@ -67,6 +67,9 @@ def try_to_get_objects_and_expect_error( @reporter.step_deco("Set versioning status to '{status}' for bucket '{bucket}'") def set_bucket_versioning(s3_client: S3ClientWrapper, bucket: str, status: VersioningStatus): + if status == VersioningStatus.UNDEFINED: + return + s3_client.get_bucket_versioning_status(bucket) s3_client.put_bucket_versioning(bucket, status=status) bucket_status = s3_client.get_bucket_versioning_status(bucket) -- 2.45.2