fix: accept allow_dynoption
This commit is contained in:
parent
e6b3e7c317
commit
3fad16d0ac
2 changed files with 6 additions and 5 deletions
|
|
@ -275,6 +275,7 @@ class _TiramisuOptionWalk:
|
||||||
validate_properties,
|
validate_properties,
|
||||||
uncalculated=uncalculated,
|
uncalculated=uncalculated,
|
||||||
with_index=with_index,
|
with_index=with_index,
|
||||||
|
check_dynamic_without_identifiers=False,
|
||||||
):
|
):
|
||||||
options.append(
|
options.append(
|
||||||
TiramisuOption(
|
TiramisuOption(
|
||||||
|
|
|
||||||
|
|
@ -396,6 +396,7 @@ class SubConfig:
|
||||||
*,
|
*,
|
||||||
uncalculated: bool = False,
|
uncalculated: bool = False,
|
||||||
with_index: bool = True,
|
with_index: bool = True,
|
||||||
|
check_dynamic_without_identifiers: bool = True,
|
||||||
):
|
):
|
||||||
if self.option.impl_is_leadership() and not uncalculated and with_index:
|
if self.option.impl_is_leadership() and not uncalculated and with_index:
|
||||||
yield from self.get_leadership_children(validate_properties)
|
yield from self.get_leadership_children(validate_properties)
|
||||||
|
|
@ -426,8 +427,7 @@ class SubConfig:
|
||||||
child,
|
child,
|
||||||
None,
|
None,
|
||||||
validate_properties,
|
validate_properties,
|
||||||
allow_dynoption=uncalculated,
|
check_dynamic_without_identifiers=check_dynamic_without_identifiers,
|
||||||
check_dynamic_without_identifiers=not uncalculated,
|
|
||||||
)
|
)
|
||||||
except PropertiesOptionError as err:
|
except PropertiesOptionError as err:
|
||||||
if err.proptype in (["mandatory"], ["empty"]):
|
if err.proptype in (["mandatory"], ["empty"]):
|
||||||
|
|
@ -452,7 +452,6 @@ class SubConfig:
|
||||||
validate_properties: bool,
|
validate_properties: bool,
|
||||||
*,
|
*,
|
||||||
properties=undefined,
|
properties=undefined,
|
||||||
allow_dynoption: bool = False,
|
|
||||||
identifier: Optional[str] = None,
|
identifier: Optional[str] = None,
|
||||||
name: Optional[str] = None,
|
name: Optional[str] = None,
|
||||||
check_index: bool = True,
|
check_index: bool = True,
|
||||||
|
|
@ -743,9 +742,11 @@ class _Config(CCache):
|
||||||
len_path = len(paths) - 1
|
len_path = len(paths) - 1
|
||||||
for idx, name in enumerate(paths):
|
for idx, name in enumerate(paths):
|
||||||
if idx != len_path:
|
if idx != len_path:
|
||||||
|
check_dynamic_without_identifiers=True
|
||||||
index_ = None
|
index_ = None
|
||||||
true_path_ = None
|
true_path_ = None
|
||||||
else:
|
else:
|
||||||
|
check_dynamic_without_identifiers=not allow_dynoption
|
||||||
index_ = index
|
index_ = index
|
||||||
true_path_ = true_path
|
true_path_ = true_path
|
||||||
|
|
||||||
|
|
@ -796,8 +797,7 @@ class _Config(CCache):
|
||||||
name=name,
|
name=name,
|
||||||
identifier=identifier,
|
identifier=identifier,
|
||||||
true_path=true_path_,
|
true_path=true_path_,
|
||||||
allow_dynoption=allow_dynoption,
|
check_dynamic_without_identifiers=check_dynamic_without_identifiers,
|
||||||
check_dynamic_without_identifiers=not allow_dynoption,
|
|
||||||
)
|
)
|
||||||
return subconfig
|
return subconfig
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue