fix: accept allow_dynoption

This commit is contained in:
egarette@silique.fr 2025-10-18 06:31:40 +02:00
parent e6b3e7c317
commit 3fad16d0ac
2 changed files with 6 additions and 5 deletions

View file

@ -275,6 +275,7 @@ class _TiramisuOptionWalk:
validate_properties,
uncalculated=uncalculated,
with_index=with_index,
check_dynamic_without_identifiers=False,
):
options.append(
TiramisuOption(

View file

@ -396,6 +396,7 @@ class SubConfig:
*,
uncalculated: bool = False,
with_index: bool = True,
check_dynamic_without_identifiers: bool = True,
):
if self.option.impl_is_leadership() and not uncalculated and with_index:
yield from self.get_leadership_children(validate_properties)
@ -426,8 +427,7 @@ class SubConfig:
child,
None,
validate_properties,
allow_dynoption=uncalculated,
check_dynamic_without_identifiers=not uncalculated,
check_dynamic_without_identifiers=check_dynamic_without_identifiers,
)
except PropertiesOptionError as err:
if err.proptype in (["mandatory"], ["empty"]):
@ -452,7 +452,6 @@ class SubConfig:
validate_properties: bool,
*,
properties=undefined,
allow_dynoption: bool = False,
identifier: Optional[str] = None,
name: Optional[str] = None,
check_index: bool = True,
@ -743,9 +742,11 @@ class _Config(CCache):
len_path = len(paths) - 1
for idx, name in enumerate(paths):
if idx != len_path:
check_dynamic_without_identifiers=True
index_ = None
true_path_ = None
else:
check_dynamic_without_identifiers=not allow_dynoption
index_ = index
true_path_ = true_path
@ -796,8 +797,7 @@ class _Config(CCache):
name=name,
identifier=identifier,
true_path=true_path_,
allow_dynoption=allow_dynoption,
check_dynamic_without_identifiers=not allow_dynoption,
check_dynamic_without_identifiers=check_dynamic_without_identifiers,
)
return subconfig