black
This commit is contained in:
parent
36931850c3
commit
d32828ad91
@ -12,9 +12,7 @@ logging.getLogger("urllib3").setLevel(logging.WARNING)
|
||||
|
||||
|
||||
def _retry(exceptions=Exception):
|
||||
|
||||
def inner(func):
|
||||
|
||||
@retry(exceptions=exceptions, delay=5, jitter=(0, 3), max_delay=60)
|
||||
@wraps(func)
|
||||
def inner(*args, **kwargs):
|
||||
@ -26,7 +24,6 @@ def _retry(exceptions=Exception):
|
||||
|
||||
|
||||
class AzureStorageAdapter(StorageAdapter):
|
||||
|
||||
def __init__(self, client):
|
||||
super().__init__(client=client)
|
||||
self.__client: BlobServiceClient = self._StorageAdapter__client
|
||||
|
||||
@ -7,8 +7,8 @@ from pyinfra.storage.adapters.adapter import StorageAdapter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class S3StorageAdapter(StorageAdapter):
|
||||
|
||||
class S3StorageAdapter(StorageAdapter):
|
||||
def __init__(self, client):
|
||||
super().__init__(client=client)
|
||||
self.__client: Minio = self._StorageAdapter__client
|
||||
|
||||
@ -21,34 +21,6 @@ class Storage:
|
||||
return self.__adapter.clear_bucket(bucket_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# import abc
|
||||
# import gzip
|
||||
# import logging
|
||||
|
||||
@ -11,4 +11,4 @@ def get_azure_storage(config=None):
|
||||
|
||||
|
||||
def get_s3_storage(config=None):
|
||||
return Storage(S3StorageAdapter(get_s3_client(config)))
|
||||
return Storage(S3StorageAdapter(get_s3_client(config)))
|
||||
|
||||
@ -58,8 +58,8 @@ def storage(client_name, bucket_name, request):
|
||||
|
||||
|
||||
def test_get_azure_storage_yields_storage():
|
||||
assert isinstance(get_azure_storage(), Storage)
|
||||
assert isinstance(get_azure_storage(), Storage)
|
||||
|
||||
|
||||
def test_get_s3_storage_yields_storage():
|
||||
assert isinstance(get_s3_storage(), Storage)
|
||||
assert isinstance(get_s3_storage(), Storage)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user