Fix fetch remotes script post projects.yaml update
The format of the projects.yaml file has been updated and
fetch_remotes.py could not parse it. Correct this by making
fetch_remotes.py aware of the format changes.
Change-Id: Ic0680d02c0e9ce31aae805ac2495957f106acb0a
Reviewed-on: https://review.openstack.org/16098
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
diff --git a/fetch_remotes.py b/fetch_remotes.py
index 4dda133..6f8ab8b 100755
--- a/fetch_remotes.py
+++ b/fetch_remotes.py
@@ -16,6 +16,12 @@
# Fetch remotes reads a project config file called projects.yaml
# It should look like:
+# - homepage: http://openstack.org
+# team-id: 153703
+# has-wiki: False
+# has-issues: False
+# has-downloads: False
+# ---
# - project: PROJECT_NAME
# options:
# - remote: https://gerrit.googlesource.com/gerrit
@@ -50,7 +56,7 @@
PROJECTS_YAML = os.environ.get('PROJECTS_YAML',
'/home/gerrit2/projects.yaml')
-config = yaml.load(open(PROJECTS_YAML))
+(defaults, config) = [config for config in yaml.load_all(open(PROJECTS_YAML))]
for section in config:
project = section['project']