summaryrefslogtreecommitdiffstats
path: root/scripts/abrt-bz-ratingfixer
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-03-11 11:46:26 +0100
committerKarel Klic <kklic@redhat.com>2010-03-11 11:46:26 +0100
commitdc9f867e4d316513bd199f072f925f0f7f2e87a4 (patch)
treeb90f1015189762ae5e18c50e079e3eb6168b173b /scripts/abrt-bz-ratingfixer
parent4c265425d0e13def1a8d0c349c0ca8e398efa2da (diff)
downloadabrt-dc9f867e4d316513bd199f072f925f0f7f2e87a4.tar.gz
abrt-dc9f867e4d316513bd199f072f925f0f7f2e87a4.tar.xz
abrt-dc9f867e4d316513bd199f072f925f0f7f2e87a4.zip
List component owners in abrt-bz-ratingfixer output
Diffstat (limited to 'scripts/abrt-bz-ratingfixer')
-rwxr-xr-xscripts/abrt-bz-ratingfixer71
1 files changed, 43 insertions, 28 deletions
diff --git a/scripts/abrt-bz-ratingfixer b/scripts/abrt-bz-ratingfixer
index 15f1a750..9bdb1276 100755
--- a/scripts/abrt-bz-ratingfixer
+++ b/scripts/abrt-bz-ratingfixer
@@ -154,42 +154,57 @@ for buginfo in buginfos:
bz.logout()
+#
+# Get the component owners
+#
+bugids = []
+for id, bug in ids.items():
+ # Skip bugs with good rating.
+ if bug['rating'] >= 3:
+ continue
+
+ # Get the component owner
+ owner = "Failed to get component owner"
+ try:
+ component_info = json.load(urllib.urlopen("https://admin.fedoraproject.org/pkgdb/packages/name/{0}?tg_format=json".format(bug['component'])))
+ component_packages = component_info['packageListings']
+ component_f12 = filter(lambda x:x["collection"]["version"]=="12", component_packages)
+ if len(component_f12) == 1:
+ owner = component_f12[0]["owner"]
+ except KeyError:
+ pass
+
+ bug['id'] = id
+ bug['owner'] = owner
+ bugids.append(bug)
+
+def ownerCmp(a, b):
+ if a['owner'] < b['owner']:
+ return -1
+ elif a['owner'] == b['owner']:
+ return 0
+ else:
+ return 1
+
print "============= SUMMARY"
-count = 0
closedcount = 0
-bugids = ids.keys()
-bugids.sort()
if options.wiki:
print "{|"
print " ! Bug !! Backtrace rating !! Comment count !! Component !! Owner"
print " |-"
-for bugid in bugids:
- bug = ids[bugid]
- if bug['rating'] < 3:
- count += 1
- if bug['comment_count'] <= 2:
- closedcount += 1
-
- # Get the component owner
- owner = "Failed to get component owner"
- try:
- component_info = json.load(urllib.urlopen("https://admin.fedoraproject.org/pkgdb/packages/name/{0}?tg_format=json".format(bug['component'])))
- component_packages = component_info['packageListings']
- component_f12 = filter(lambda x:x["collection"]["version"]=="12", component_packages)
- if len(component_f12) == 1:
- owner = component_f12[0]["owner"]
- except KeyError:
- pass
-
- if options.wiki:
- print " | #[https://bugzilla.redhat.com/show_bug.cgi?id={0} {0}] || {1}/4 || {2} || {3} || {4}".format(bugid, bug['rating'], bug['comment_count'], bug['component'], owner)
- print " |-"
- else:
- print "#{0} has a backtrace with rating {1}/4 and {2} comments, component {3}, owner {4}".format(bugid, bug['rating'], bug['comment_count'], bug['component'], owner)
+for bug in sorted(bugids, ownerCmp):
+ count += 1
+ if bug['comment_count'] <= 2:
+ closedcount += 1
+
+ if options.wiki:
+ print " | #[https://bugzilla.redhat.com/show_bug.cgi?id={0} {0}] || {1}/4 || {2} || {3} || {4}".format(bug['id'], bug['rating'], bug['comment_count'], bug['component'], bug['owner'])
+ print " |-"
+ else:
+ print "#{0} has a backtrace with rating {1}/4 and {2} comments, component {3}, owner {4}".format(bug['id'], bug['rating'], bug['comment_count'], bug['component'], bug['owner'])
if options.wiki:
print " |}"
-
-print "{0} bugs are included.".format(count)
+print "{0} bugs are included.".format(len(bugids))
print "{0} bugs should be closed.".format(closedcount)