Compare commits
2 commits
0a97dc877e
...
86c5f754dd
| Author | SHA1 | Date | |
|---|---|---|---|
| 86c5f754dd | |||
| a417517e61 |
7 changed files with 24 additions and 11 deletions
|
|
@ -1,3 +1,9 @@
|
|||
## 1.2.0a71 (2026-03-18)
|
||||
|
||||
### Fix
|
||||
|
||||
- auto redefine in type is only for default
|
||||
|
||||
## 1.2.0a70 (2026-03-18)
|
||||
|
||||
### Feat
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "rougail"
|
||||
version = "1.2.0a70"
|
||||
version = "1.2.0a71"
|
||||
|
||||
[tool.commitizen]
|
||||
name = "cz_conventional_commits"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail-base"
|
||||
version = "1.2.0a70"
|
||||
version = "1.2.0a71"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "A consistency handling system that was initially designed in the configuration management"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail"
|
||||
version = "1.2.0a70"
|
||||
version = "1.2.0a71"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "A consistency handling system that was initially designed in the configuration management"
|
||||
|
|
@ -27,7 +27,7 @@ classifiers = [
|
|||
dependencies = [
|
||||
"ruamel.yaml ~= 0.18.6",
|
||||
"pydantic ~= 2.9.2",
|
||||
"rougail-base == 1.2.0a70",
|
||||
"rougail-base == 1.2.0a71",
|
||||
]
|
||||
|
||||
[tool.flit.sdist]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "1.2.0a70"
|
||||
__version__ = "1.2.0a71"
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ class ParserVariable:
|
|||
exists = obj.pop("exists", None)
|
||||
else:
|
||||
exists = None
|
||||
redefine = obj.pop("redefine", False) or (force_redefine is True and path in self.paths)
|
||||
redefine = self.is_redefine(path, obj, force_redefine)
|
||||
obj_type = self.get_family_or_variable_type(obj)
|
||||
family_obj, children_obj = self.split_param_family_children(path, sources, obj_type, obj)
|
||||
if self.version != "1.0" and not family_obj and comment:
|
||||
|
|
@ -430,7 +430,7 @@ class ParserVariable:
|
|||
copy_before_set=True,
|
||||
custom_type=True,
|
||||
)
|
||||
force_redefine=True
|
||||
force_redefine = True
|
||||
family_obj, children_obj = self.split_param_family_children(path, sources, obj_type, obj)
|
||||
family_obj["type"] = self.paths[path].type
|
||||
if path in self.paths:
|
||||
|
|
@ -522,6 +522,10 @@ class ParserVariable:
|
|||
copy_before_set=copy_before_set,
|
||||
custom_type=custom_type,
|
||||
)
|
||||
|
||||
def is_redefine(self, path: str, obj, force_redefine: bool):
|
||||
return obj.pop("redefine", False) or (force_redefine is True and path in self.paths and list(obj) in [[], ["default"]])
|
||||
|
||||
def split_param_family_children(self, path, sources, obj_type, obj):
|
||||
family_obj = {}
|
||||
children_obj = {}
|
||||
|
|
@ -716,7 +720,7 @@ class ParserVariable:
|
|||
self.parse_params(path, obj, sources)
|
||||
self.parse_secret_manager(path, obj, sources, family_is_dynamic, copy_before_set)
|
||||
exists = obj.pop("exists", None)
|
||||
redefine = obj.pop("redefine", False) or (force_redefine is True and path in self.paths)
|
||||
redefine = self.is_redefine(path, obj, force_redefine)
|
||||
if not redefine and not exists:
|
||||
obj_type = obj.get("type")
|
||||
if obj_type in self.custom_variable_types:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ my_leadership_4:
|
|||
|
||||
my_leadership:
|
||||
|
||||
a_leader: # a description
|
||||
a_leader:
|
||||
description: a description
|
||||
redefine: true
|
||||
default:
|
||||
- a value leader
|
||||
- a second leader
|
||||
...
|
||||
|
|
|
|||
Loading…
Reference in a new issue