mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix loading empty yaml files with include_dir_named (#107853)
This commit is contained in:
parent
5afe155cd9
commit
6cab4486f7
@ -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)
|
||||
|
||||
|
||||
|
@ -193,7 +193,7 @@ def test_include_dir_list_recursive(
|
||||
),
|
||||
(
|
||||
{"/test/first.yaml": "1", "/test/second.yaml": None},
|
||||
{"first": 1},
|
||||
{"first": 1, "second": None},
|
||||
),
|
||||
],
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user