- remove build specs - move pytest.ini into pyproject.toml - update readme - add pre-commit config - run formatters - add Makefile
16 lines
464 B
Python
16 lines
464 B
Python
from pyinfra.config import Config
|
|
from pyinfra.storage.adapters.azure import get_azure_storage
|
|
from pyinfra.storage.adapters.s3 import get_s3_storage
|
|
|
|
|
|
def get_storage(config: Config):
|
|
|
|
if config.storage_backend == "s3":
|
|
storage = get_s3_storage(config)
|
|
elif config.storage_backend == "azure":
|
|
storage = get_azure_storage(config)
|
|
else:
|
|
raise Exception(f"Unknown storage backend '{config.storage_backend}'.")
|
|
|
|
return storage
|