From 8a1c27bc924496172d89483d1959f1c32d495df1 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 18 Aug 2021 16:28:56 +0200 Subject: [PATCH] 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 --- kas/libkas.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kas/libkas.py b/kas/libkas.py index 215f80a..af72d05 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -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()))