From 76e59ff2b01d60baa984ca9d59a3fc781b4e075c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Nov 13 2024 16:56:43 +0000 Subject: closebugs: don't overwrite specific failure If we hit a failure when trying to update a bug and we did get a specific HTTPError, but we also didn't touch the bug (which seems likely), we'll first set `failed_bugs[bug]` to the specific error from the HTTPError, but then overwrite it with the generic text "Unknown Bugzilla failure", which doesn't seem like a good idea. We should only set it to "Unknown Bugzilla failure" if we didn't get a specific HTTPError already. Signed-off-by: Adam Williamson --- diff --git a/closebugs/fedora_bz.py b/closebugs/fedora_bz.py index 8650409..cdffd1f 100755 --- a/closebugs/fedora_bz.py +++ b/closebugs/fedora_bz.py @@ -262,7 +262,8 @@ def update_bugs(bugs, update): '%Y%m%dT%H:%M:%S') update_interval = datetime.utcnow() - last_update_time if update_interval.seconds > 5: - failed_bugs[bug] = "Unknown Bugzilla failure" + if bug not in failed_bugs: + failed_bugs[bug] = "Unknown Bugzilla failure" else: print("\tSuccess")