Add UNDEFINED versionins status #70

Merged
abereziny merged 1 commit from abereziny/frostfs-testlib:feature-add-undefined-versioning-status into master 2023-08-07 08:40:00 +00:00
2 changed files with 4 additions and 0 deletions

View file

@ -15,6 +15,7 @@ def _make_objs_dict(key_names):
class VersioningStatus(HumanReadableEnum): class VersioningStatus(HumanReadableEnum):
UNDEFINED = None
ENABLED = "Enabled" ENABLED = "Enabled"
SUSPENDED = "Suspended" SUSPENDED = "Suspended"

View file

@ -67,6 +67,9 @@ def try_to_get_objects_and_expect_error(
@reporter.step_deco("Set versioning status to '{status}' for bucket '{bucket}'") @reporter.step_deco("Set versioning status to '{status}' for bucket '{bucket}'")
def set_bucket_versioning(s3_client: S3ClientWrapper, bucket: str, status: VersioningStatus): 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.get_bucket_versioning_status(bucket)
s3_client.put_bucket_versioning(bucket, status=status) s3_client.put_bucket_versioning(bucket, status=status)
bucket_status = s3_client.get_bucket_versioning_status(bucket) bucket_status = s3_client.get_bucket_versioning_status(bucket)