Fix loading empty yaml files with include_dir_named (#107853)

This commit is contained in:
Pedro Lamas 2024-01-16 09:23:04 +00:00 committed by GitHub
parent 5afe155cd9
commit 6cab4486f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -359,10 +359,7 @@ def _include_dir_named_yaml(loader: LoaderType, node: yaml.nodes.Node) -> NodeDi
filename = os.path.splitext(os.path.basename(fname))[0]
if os.path.basename(fname) == SECRET_YAML:
continue
loaded_yaml = load_yaml(fname, loader.secrets)
if loaded_yaml is None:
continue
mapping[filename] = loaded_yaml
mapping[filename] = load_yaml(fname, loader.secrets)
return _add_reference(mapping, loader, node)