diff --git a/backend/run/copr-backend-unknown-resalloc-tickets.py b/backend/run/copr-backend-unknown-resalloc-tickets.py index b7d8df60d..6acc55787 100755 --- a/backend/run/copr-backend-unknown-resalloc-tickets.py +++ b/backend/run/copr-backend-unknown-resalloc-tickets.py @@ -33,7 +33,9 @@ def used_ids(): output = output.strip() tickets = set() for ticket_id in output.split("\n"): - assert all(c.isdigit() for c in ticket_id) + if len(ticket_id) <= 0: + continue + assert c.isdigit() tickets.add(int(ticket_id)) return tickets @@ -61,11 +63,13 @@ def print_once(message): print(message) storage[message] = True - -if __name__ == "__main__": +def _main(): script_requires_user("resalloc") used = used_ids() + if not used: + print("no tickets used") + return # This is the oldest ticket that Copr Backend currently uses. min_used = min(used) @@ -80,3 +84,9 @@ def print_once(message): else: print_once("These tickets are relatively new for closing blindly, double check!") print(f"resalloc ticket-check {unknown_id}") + + return 0 + + +if __name__ == "__main__": + _main()