Skip to content

Adopt teardown for S3 services without versioning support #1

Open
alexvanin opened this issue Feb 15, 2023 · 0 comments
Open

Adopt teardown for S3 services without versioning support #1

alexvanin opened this issue Feb 15, 2023 · 0 comments

Comments

@alexvanin
Copy link

If S3 server does not support versioning, then teardown fails on every test. Teardown uses client.list_object_versions which throws exception on S3 servers without versioning support.

for objects in list_versions(client, bucket, batch_size):

s3tests_boto3/functional/__init__.py:320:                                                                                                                                                                                                                                                                                                                   
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _                                                                                                                                                                                                                                                                             
s3tests_boto3/functional/__init__.py:290: in teardown                                                                                                                                                                                                                                                                                                       
    nuke_prefixed_buckets(prefix=prefix)                                                                                                                                      
s3tests_boto3/functional/__init__.py:164: in nuke_prefixed_buckets                                                                                                            
    raise err                                                                                                                                                                                                                                                                                                                                               
s3tests_boto3/functional/__init__.py:155: in nuke_prefixed_buckets                                                                                                                                                                                                                                                                                          
    nuke_bucket(client, bucket_name)                                                                                                                                          
s3tests_boto3/functional/__init__.py:108: in nuke_bucket                                                                                                                      
    for objects in list_versions(client, bucket, batch_size):                                                                                                                 
s3tests_boto3/functional/__init__.py:93: in list_versions                                                                                                                     
    MaxKeys=batch_size)                                                                                                                                                                                                                                                                                                                                     
.tox/py/lib/python3.7/site-packages/botocore/client.py:530: in _api_call                                                                                                                                                                                                                                                                                    
    return self._make_api_call(operation_name, kwargs)
...
        if http.status_code >= 300:
            error_code = parsed_response.get("Error", {}).get("Code")
            error_class = self.exceptions.from_code(error_code)
>           raise error_class(parsed_response, operation_name)
E           botocore.exceptions.ClientError: An error occurred (NotImplemented) when calling the ListObjectVersions operation: Subresources not implemented

Teardown might be a bit smarter and use list_objects if bucket versioning is disabled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant