Allow nonexistent releases in default_data

Each "repos" data can contain the list of releases.
If not containing releases, TypeError happens on current code.
This patch makes the code allow nonexistent releases instead of
the exception.

Change-Id: I264784bdfbd016cbd0225a0604d03acfe5ecf967
This commit is contained in:
Ken'ichi Ohmichi
2017-02-27 14:53:14 -08:00
parent f9b1aa8945
commit 23b40260b5

View File

@@ -111,7 +111,7 @@ def _process_repo(repo, runtime_storage_inst, record_processor_inst,
vcs_inst.fetch()
branches = {repo.get('default_branch', 'master')}
for release in repo.get('releases'):
for release in repo.get('releases', []):
if 'branch' in release:
branches.add(release['branch'])