bodhi/model.py | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
New commits:
commit f17903aee51ae80b5d480f7f419ba927c073302a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jan 22 15:01:02 2009 -0500
Only modify and close bugs under the 'Fedora' product.
Also, only change bugs to ON_QA if the developer selected
to 'Automatically close bugs'.
This fixes infra#312 and bodhi#273.
diff --git a/bodhi/model.py b/bodhi/model.py
index 61f360d..3d7b48e 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -891,25 +891,28 @@ class Bugzilla(SQLObject):
Change the status of this bug to ON_QA, and comment on the bug with
some details on how to test and provide feedback for this update.
"""
- bz = Bugzilla.get_bz()
- comment = self._default_message(update)
- log.debug("Setting Bug #%d to ON_QA" % self.bz_id)
- try:
- bug = bz.getbug(self.bz_id)
- if bug.product == 'Security Response':
- log.warning("Skipping Security Response bug")
- return
- bug.setstatus('ON_QA', comment=comment)
- except Exception, e:
- log.error("Unable to alter bug #%d\n%s" % (self.bz_id, str(e)))
+ if update.close_bugs:
+ bz = Bugzilla.get_bz()
+ comment = self._default_message(update)
+ log.debug("Setting Bug #%d to ON_QA" % self.bz_id)
+ try:
+ bug = bz.getbug(self.bz_id)
+ if bug.product != 'Fedora':
+ log.warning("Skipping %r bug" % bug.product)
+ return
+ bug.setstatus('ON_QA', comment=comment)
+ except Exception, e:
+ log.error("Unable to alter bug #%d\n%s" % (self.bz_id,
str(e)))
+ else:
+ log.debug('Skipping bug modification, close_bugs == False')
def close_bug(self, update):
bz = Bugzilla.get_bz()
try:
ver = '-'.join(get_nvr(update.builds[0].nvr)[-2:])
bug = bz.getbug(self.bz_id)
- if bug.product == 'Security Response':
- log.warning("Not closing Security Response bug")
+ if bug.product != 'Fedora':
+ log.warning("Not closing %r bug" % bug.product)
return
bug.close('NEXTRELEASE', fixedin=ver)
except xmlrpclib.Fault, f:
Show replies by date