added simpler loader

This commit is contained in:
Ari Sosnovsky committed 2021-11-11 12:33:33 -05:00
1 parent d6adbb897d
commit c493c0a3d0
6 files changed
+118 -12

No files matched your search

+9 -1
View File
@@ -1,6 +1,14 @@
from ruamel.yaml import YAML
from src.yaml_serializer.types import IncludedYaml, SecretValue
from src.yaml_serializer.types import IncludedYaml, IncludedYamlDir, SecretValue
yaml = YAML()
yaml.register_class(IncludedYaml)
yaml.register_class(SecretValue)
yaml.register_class(IncludedYamlDir)
yaml.constructor.add_constructor("!include", IncludedYaml.from_yaml)
yaml.constructor.add_constructor("!secret", SecretValue.from_yaml)
yaml.constructor.add_constructor("!env_var", IncludedYamlDir.from_yaml)
yaml.constructor.add_constructor("!include_dir_list", IncludedYamlDir.from_yaml)
yaml.constructor.add_constructor("!include_dir_merge_list", IncludedYamlDir.from_yaml)
yaml.constructor.add_constructor("!include_dir_named", IncludedYamlDir.from_yaml)
yaml.constructor.add_constructor("!include_dir_merge_named", IncludedYamlDir.from_yaml)