Fix the zuul main.yaml config checks

It is possible to have two different types of dict listings for zuul
tenant project lists. The first (which we handled fine) is a dict per
project where we list which items we include from that project. The
other is a dict with global settings and a list of projects. Handle this
second case.

Change-Id: I03969da4595f4c66db36cab35ef96a33c6766002
This commit is contained in:
Clark Boylan 2019-09-17 15:30:39 -07:00
parent aedf049539
commit 4a94d0debf

View File

@ -115,9 +115,14 @@ def check_zuul_main(zuul_main, projects):
for project_types in sources['gerrit']:
for entry in sources['gerrit'][project_types]:
if isinstance(entry, dict):
for x in entry.keys():
found_errors += check_project_exists(
x, project_names)
if 'projects' in entry:
for x in entry['projects']:
found_errors += check_project_exists(
x, project_names)
else:
for x in entry.keys():
found_errors += check_project_exists(
x, project_names)
else:
found_errors += check_project_exists(
entry, project_names)