diff options
author | Till Maas <opensource@till.name> | 2009-07-18 23:10:32 +0200 |
---|---|---|
committer | Till Maas <opensource@till.name> | 2009-07-18 23:10:32 +0200 |
commit | 73a2ddac4fab166149aae400ef6fad6ce8311401 (patch) | |
tree | 2d9fab4d3cdade40c41a78155c0f6885aaeb5dcf /lib | |
parent | 31c84d0a6895f321307b7494232c4cc655fecf95 (diff) | |
parent | 6f04a3896a3aaed612ede34a45772c69c2705c7c (diff) | |
download | cnucnu-73a2ddac4fab166149aae400ef6fad6ce8311401.tar.gz cnucnu-73a2ddac4fab166149aae400ef6fad6ce8311401.tar.xz cnucnu-73a2ddac4fab166149aae400ef6fad6ce8311401.zip |
Merge branch 'work' into setup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cnucnu/bugzilla_reporter.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/cnucnu/bugzilla_reporter.py b/lib/cnucnu/bugzilla_reporter.py index 9af3407..1c336d9 100644 --- a/lib/cnucnu/bugzilla_reporter.py +++ b/lib/cnucnu/bugzilla_reporter.py @@ -30,10 +30,15 @@ class BugzillaReporter(object): bug_status_closed = ['CLOSED'] new_bug = {'version': 'rawhide', - 'status': 'ASSIGNED', +# Using assigned returns an exception: +# <Fault 32000: 'You are not allowed to file new bugs with the\n ASSIGNED status.'> +# if the account is in editbugs, fedora_bugs, fedora_contrib, setpriority +# if not, then it is silently ignored +# 'status': 'ASSIGNED', + 'status': 'NEW', 'keywords': 'FutureFeature' } - + summary_template = "%(name)s-%(latest_upstream)s is available" description_template = \ """Latest upstream release: %(latest_upstream)s Current version in %(repo_name)s: %(repo_version)s @@ -50,6 +55,7 @@ https://fedoraproject.org/wiki/Using_FEver_to_track_upstream_changes""" self.base_query['product'] = [bugzilla_product] self.base_query['email1'] = [bugzilla_username] self.new_bug['product'] = bugzilla_product + self.bugzilla_username = bugzilla_username def report_outdated(self, package, dry_run=True): @@ -60,13 +66,14 @@ https://fedoraproject.org/wiki/Using_FEver_to_track_upstream_changes""" open = self.get_open(package) if not open: bug = {'component': package.name, - 'summary': "%(name)s-%(latest_upstream)s is available" % package, + 'summary': self.summary_template % package, 'description': self.description_template % package } bug.update(self.new_bug) if not dry_run: new_bug = self.bz.createbug(**bug) + print self.bz._proxy.bugzilla.changeStatus(new_bug.bug_id, "ASSIGNED", self.bugzilla_username, "", "", False, False, 1) print "https://bugzilla.redhat.com/show_bug.cgi?id=%s" % new_bug.bug_id else: pprint(bug) @@ -80,8 +87,13 @@ https://fedoraproject.org/wiki/Using_FEver_to_track_upstream_changes""" bug_version = summary.split(" ")[0][len(package.name)+1:] if bug_version != package.latest_upstream: - # :TODO: - print "bug needs to be updated, but python-bugzilla seems not to support updating summary" + # :TODO: comment creation untested + update = {'short_desc': self.summary_template % package, + 'comment': self.description_template % package + } + res = self.bz._update_bugs(open_bug.bug_id, update) + print res + return res else: for bug in matching_bugs: print "bug already filed: https://bugzilla.redhat.com/show_bug.cgi?id=%s %s" % (bug.bug_id, bug.bug_status) |