Skip to content

Commit 4a03e77

Browse files
committed
config: Find YAML files recursively
Previously only top-level files were found in a given directory. Fixes: #2859 Signed-off-by: Paweł Wieczorek <pawiecz@collabora.com>
1 parent f260a09 commit 4a03e77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernelci/config/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def iterate_yaml_files(config_path: str):
2222
over the file(s) as (path, data) 2-tuples.
2323
"""
2424
if config_path.endswith('.yaml'):
25-
yaml_files = [config_path]
25+
yaml_files = iter([config_path])
2626
else:
27-
yaml_files = glob.glob(os.path.join(config_path, "*.yaml"))
27+
yaml_files = glob.iglob(os.path.join(config_path, "**", "*.yaml"), recursive=True)
2828
for yaml_path in yaml_files:
2929
with open(yaml_path, encoding='utf8') as yaml_file:
3030
data = yaml.safe_load(yaml_file)

0 commit comments

Comments
 (0)