diff options
author | Karel Klic <kklic@redhat.com> | 2010-05-24 17:38:18 +0200 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-06-09 17:18:47 +0200 |
commit | 7ee56c1137f403244b27208f72c99ff5e7d45431 (patch) | |
tree | 0301d3ca7b130948358b7ce6d7b4af50d7e69f66 /scripts/abrt-bz-dupchecker | |
parent | edbd2766911848c7ba808eea370989f5c12bd3a1 (diff) | |
download | abrt-7ee56c1137f403244b27208f72c99ff5e7d45431.tar.gz abrt-7ee56c1137f403244b27208f72c99ff5e7d45431.tar.xz abrt-7ee56c1137f403244b27208f72c99ff5e7d45431.zip |
abrt-bz-dupchecker: check status of master bug befor marking duplicates
Diffstat (limited to 'scripts/abrt-bz-dupchecker')
-rwxr-xr-x | scripts/abrt-bz-dupchecker | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/abrt-bz-dupchecker b/scripts/abrt-bz-dupchecker index b337934e..65e11531 100755 --- a/scripts/abrt-bz-dupchecker +++ b/scripts/abrt-bz-dupchecker @@ -212,15 +212,24 @@ if options.close: else: return -1 + # Sort the duplicates by the number of comments. + # Select the bug with the highest number of comments as the master bug. + # All other bugs without user comments will be closed as a duplicate of + # the master bug. sorteditems = sorted(bugitems, commentCmp) - master = sorteditems[0] + + # Check the master bug status AGAIN to make sure the bug is still opened. + bug = bz.getbug(int(master['id'])) + if not bug.bug_status in ["NEW", "ASSIGNED"]: + continue + for item in sorteditems[1:]: if item['comments'] > 2: continue - bug = bz.getbug(int(item['id'])) # Check the bug status AGAIN to make sure the bug is still opened. + bug = bz.getbug(int(item['id'])) if not bug.bug_status in ["NEW", "ASSIGNED"]: continue |