EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 05b77115 authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Fixing cases for multi-bucket/container setup

parent 1cd24b7f
No related branches found
No related tags found
3 merge requests!36Staging to master to prepare 1.0.0 release,!32Registrar modularization,!27Registrar modularization
......@@ -54,6 +54,7 @@ class EOxServerBackend(Backend):
storage_type='local',
)
storage_name = storage.name
elif isinstance(source, S3Source):
params = json.dumps({
'ACCESS_KEY_ID': source.access_key_id,
......@@ -70,7 +71,7 @@ class EOxServerBackend(Backend):
bucket, _ = source.get_bucket_and_key(path)
storage, created_storage = backends.Storage.objects.get_or_create(
name=source.name,
name=source.name if source.bucket else f'{source.name}-{bucket}',
url=bucket,
storage_type='S3',
storage_auth=storage_auth,
......@@ -98,7 +99,7 @@ class EOxServerBackend(Backend):
container, _ = source.get_container_and_path(path)
storage, created_storage = backends.Storage.objects.get_or_create(
name=source.name,
name=source.name if source.container else f'{source.name}-{container}',
url=container,
storage_type='swift',
storage_auth=storage_auth,
......
......@@ -35,6 +35,7 @@ def register_file(config: dict, path: str, replace: bool=False):
for post_handler in get_post_handlers(config):
post_handler(config, path, context)
logger.info(f"Successfully {'replaced' if replace else 'registered'} '{path}'")
return context
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment