diff options
author | Karel Klic <kklic@redhat.com> | 2010-02-15 14:02:25 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-02-15 14:02:25 +0100 |
commit | 55ef6d8102047344f170dcb1202a117302ae3768 (patch) | |
tree | 7b9417a8a7da3a9a111f708fbba75b3446fd4942 /scripts/abrt-bz-ratingfixer | |
parent | f49b4e72dc22d004ada91292fcd7179956de81c4 (diff) | |
download | abrt-55ef6d8102047344f170dcb1202a117302ae3768.tar.gz abrt-55ef6d8102047344f170dcb1202a117302ae3768.tar.xz abrt-55ef6d8102047344f170dcb1202a117302ae3768.zip |
Added option to close bugs with low rating: --close
Diffstat (limited to 'scripts/abrt-bz-ratingfixer')
-rwxr-xr-x | scripts/abrt-bz-ratingfixer | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/abrt-bz-ratingfixer b/scripts/abrt-bz-ratingfixer index 66c2b628..15f1a750 100755 --- a/scripts/abrt-bz-ratingfixer +++ b/scripts/abrt-bz-ratingfixer @@ -25,10 +25,12 @@ parser.add_option("-u", "--user", dest="user", help="Bugzilla user name (REQUIRED)", metavar="USERNAME") parser.add_option("-p", "--password", dest="password", help="Bugzilla password (REQUIRED)", metavar="PASSWORD") -parser.add_option("-b", "--bugzilla", dest="bugzilla", +parser.add_option("-b", "--bugzilla", dest="bugzilla", default="https://bugzilla.redhat.com/xmlrpc.cgi", help="Bugzilla URL (defaults to Red Hat Bugzilla)", metavar="URL") parser.add_option("-i", "--wiki", help="Generate output in wiki syntax", action="store_true", default=False, dest="wiki") +parser.add_option("-c", "--close", help="Close some of the bugs in Bugzilla (DANGEROUS)", + action="store_true", default=False, dest="close") (options, args) = parser.parse_args() if not options.user or len(options.user) == 0: @@ -37,9 +39,6 @@ if not options.user or len(options.user) == 0: if not options.password or len(options.password) == 0: parser.error("Password is required.\nTry {0} --help".format(sys.argv[0])) -if not options.bugzilla or len(options.bugzilla) == 0: - options.bugzilla = "https://bugzilla.redhat.com/xmlrpc.cgi" - # # Connect to the Bugzilla and get all bugs reported by ABRT # @@ -145,6 +144,14 @@ for buginfo in buginfos: 'component': buginfo.component } + # Close the bug if it's appropriate. + if options.close and comment_count <= 2 and int(rating) < 3: + print "Closing bug #{0} with {1} comments and rating {2}/4.".format(buginfo.bug_id, comment_count, int(rating)) + bug.close("INSUFFICIENT_DATA", 0, "", + "This bug appears to have been filled using a buggy version of ABRT, because\n" + + "it contains unusable backtrace. Sorry for the inconvenience.\n\n" + + "Closing as INSUFFICIENT_DATA.") + bz.logout() print "============= SUMMARY" |