api: persistence allow path prefix

This commit is contained in:
Johannes Kirschbauer
2025-10-16 12:41:54 +02:00
parent a4839f9cf2
commit 8254d197f0

View File

@@ -105,13 +105,12 @@ def get_inventory_exclusive(value: dict, inventory_file_name: str) -> bool | Non
if "__this" not in value: if "__this" not in value:
return None return None
definition_locations = value.get("__this", {}).get("files") definition_locations: list[str] = value.get("__this", {}).get("files")
if not definition_locations: if not definition_locations:
return None return None
return ( return len(definition_locations) == 1 and definition_locations[0].endswith(
len(definition_locations) == 1 inventory_file_name
and definition_locations[0] == inventory_file_name
) )