From edad8d4461c29f98cfcca462114ea2473063b19d Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Feb 02 2022 16:07:02 +0000 Subject: hub: fix Task.lock for correctly closed tasks Fixes: https://pagure.io/koji/issue/3220 --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 40dfe8b..6f98161 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -214,9 +214,11 @@ class Task(object): log_error(f"Error: task {task_id} is already open and handled by " f"{host_id} (double open/assign)") return False - elif otherhost is None: # CLOSED, FAILED - log_error(f"Error: task {task_id} is non-free but not handled by any host " - f"(state {koji.TASK_STATES[state]})") + else: + # state is CLOSED or FAILED + if otherhost is None: + log_error(f"Error: task {task_id} is non-free but not handled by any host " + f"(state {koji.TASK_STATES[state]})") return False # if we reach here, task is either # - free and unlocked