From 7c0acaaa107bc965df24e539811127b433339f69 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jun 25 2020 08:47:20 +0000 Subject: koji-gc: fix py3 compare behaviour for dicts Fixes: https://pagure.io/koji/issue/2325 --- diff --git a/util/koji-gc b/util/koji-gc index 87b7b86..07c693a 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -526,8 +526,11 @@ def handle_trash(): else: age = time.time() - ts else: - history = [(h['revoke_event'], h) for h in history] - last = max(history)[1] + last = history[0] + for h in history: + actual = h['revoke_event'] or 0 + if not last['revoke_event'] or actual > last['revoke_event']: + last = h if not last['revoke_event']: # this might happen if the build was tagged just now print("[%i/%i] Warning: build not untagged: %s" % (i, N, nvr))