From 3c9b1c3bf1f6922e7d77c93c6d7b7bf24ed05d7a Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 15 Feb 2022 20:24:24 +0000 Subject: [PATCH] Read tenant config with care in github_manager The addition of ACLs to zuul/main.yaml broke the naive parsing done by the maintain-github-mirror playbook, as it assumed all list items were tenant definitions. Add a conditional check to allow it to skip past any which aren't. Change-Id: I31ab916a17fd116f00e94ea7bfa4d7243c0e1c2c --- playbooks/maintain-github-mirror/github_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/maintain-github-mirror/github_manager.py b/playbooks/maintain-github-mirror/github_manager.py index 9a38e3dd3e..d87d0b5797 100755 --- a/playbooks/maintain-github-mirror/github_manager.py +++ b/playbooks/maintain-github-mirror/github_manager.py @@ -85,7 +85,7 @@ def list_repos_in_zuul(project_config, tenant='openstack', org='openstack'): main_yaml_filename = os.path.join(project_config, 'zuul/main.yaml') with open(main_yaml_filename, 'r') as main_yaml: for t in yaml.safe_load(main_yaml): - if t['tenant']['name'] == tenant: + if 'tenant' in t and t['tenant']['name'] == tenant: for ps, pt in t['tenant']['source']['gerrit'].items(): for elem in pt: if type(elem) is dict: