EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 3114eabb authored by Fabian Schindler-Strauss's avatar Fabian Schindler-Strauss
Browse files

Merge branch 'integration-test' into 'main'

Fix product type filtering

See merge request !3
parents 4b6d9a4e 67f97dec
No related branches found
No related tags found
1 merge request!3Fix product type filtering
Pipeline #19173 passed
......@@ -39,10 +39,12 @@ backends:
-{{ toYaml . | nindent 6 }}
{{- end }}
{{- if not (empty .Values.pathBackends) }}
path_backends:
{{- range .Values.pathBackends }}
-{{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- if not (empty .Values.preHandlers) }}
pre_handlers:
......
......@@ -40,7 +40,7 @@ def get_path_backends(config: dict) -> List[PathBackend]:
carried out
"""
backends = []
for cfg_backend in config["path_backends"]:
for cfg_backend in config.get("path_backends", []):
# construct backend
backend_cls = import_by_path(cfg_backend["path"])
......
......@@ -276,6 +276,7 @@ class EOxServerBackend(ItemBackend):
storage = self._get_storage_from_source(source, item)
product_type_found = False
# match self.product_types with item
for product_type in self.product_types:
match = []
......@@ -292,12 +293,14 @@ class EOxServerBackend(ItemBackend):
match.append(False)
if all(match):
product_type = product_type
product_type_found = True
break
else:
raise RegistrationError(f"{item} not matched to any product_type")
else:
break
if not product_type_found:
raise RegistrationError(f"{item} not matched to any product_type")
logger.info(f"Registering into EOxServer for type " f'"{product_type["name"]}"')
product = self._register_with_stac(source, item, replace, storage, product_type)
......
......@@ -61,7 +61,7 @@ def cli():
@click.option("--progress-set", type=str)
@click.option("--failure-set", type=str)
@click.option("--success-set", type=str)
@click.option("--extra/-e", type=str, multiple=True, default=[])
@click.option("-e", "--extra", type=str, multiple=True, default=[])
@click.option("--debug", is_flag=True)
def daemon(
config_file=None,
......@@ -121,7 +121,6 @@ def daemon(
progress_set,
failure_set,
success_set,
deregister_queue,
)
......
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