From 44df7f046cd0e1c05027ed09bdbbfaf4acb614c7 Mon Sep 17 00:00:00 2001 From: Mariana Ulaieva Date: Dec 16 2019 15:39:50 +0000 Subject: Don't expect module build tasks to have "rpms" There are module builds, which won't build any components.There are module builds, which won't build any components. These module builds won't have an "rpms" key in "tasks". Expect this to happen and don't fail when watching module builds of this kind. Signed-off-by: Mariana Ulaieva --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 7fbc6c2..9342af8 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -3821,7 +3821,7 @@ class Commands(object): # with -1 so that None does not impact the comparison for # sort. formatted_tasks = [] - for pkg_name, task_info in module_build['tasks']['rpms'].items(): + for pkg_name, task_info in module_build['tasks'].get("rpms", {}).items(): new_task_info = task_info.copy() new_task_info['package_name'] = pkg_name if new_task_info['state'] is None: