libkas: Gracefully handle empty repo set

We will fail differently then, but with a nicer error message (missing
init-build-env script) than

ValueError: Set of coroutines/Futures is empty.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2021-08-18 16:28:56 +02:00
parent 4c81f96742
commit 8a1c27bc92

View File

@ -163,6 +163,9 @@ def repos_fetch(repos):
"""
Fetches the list of repositories to the kas_work_dir.
"""
if len(repos) == 0:
return
tasks = []
for repo in repos:
tasks.append(asyncio.ensure_future(repo.fetch_async()))
@ -179,6 +182,9 @@ def repos_apply_patches(repos):
"""
Applies the patches to the repositories.
"""
if len(repos) == 0:
return
tasks = []
for repo in repos:
tasks.append(asyncio.ensure_future(repo.apply_patches_async()))