]> err.no Git - dak/commitdiff
dak/process_policy.py, daklib/announce.py: fix bugs in new announce code
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 15 Aug 2012 20:01:36 +0000 (22:01 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Wed, 15 Aug 2012 20:01:36 +0000 (22:01 +0200)
dak/process_policy.py
daklib/announce.py

index 3bde725251c3f6737dbf7bef2e86de7e8b73969c..30e10c4d06679f1b93c934cf003f07463ee6756a 100755 (executable)
@@ -157,7 +157,7 @@ def comment_accept(upload, srcqueue, comments, transaction):
         Logger.log(["Policy Queue ACCEPT", srcqueue.queue_name, changesname])
 
     pu = get_processed_upload(upload)
-    daklib.announce.announce_accept(upload)
+    daklib.announce.announce_accept(pu)
 
     # TODO: code duplication. Similar code is in process-upload.
     # Move .changes to done
index 6ab4b0059aa33586f6d9c90100783422f2df01d5..51a07d90f99965edd8eb464c49221997999249cf 100644 (file)
@@ -125,18 +125,24 @@ def announce_accept(upload):
 
     if accepted_to_real_suite and upload.sourceful:
         # senf mail to announce lists and tracking server
-        announce = set(suite.announce or [] for suite in upload.suites if suite.policy_queue is None)
+        announce = set()
+        for suite in upload.suites:
+            if suite.policy_queue is None:
+                continue
+            announce.update(suite.announce or [])
+
         announce_list_address = ", ".join(announce)
 
         tracking = cnf.get('Dinstall::TrackingServer')
         if tracking:
             announce_list_address = "{0}\n{1}@{2}".format(announce_list_address, upload.source, tracking)
 
-        my_subst = subst.copy()
-        my_subst['__ANNOUNCE_LIST_ADDRESS__'] = announce_list_address
+        if len(announce_list_address) != 0:
+            my_subst = subst.copy()
+            my_subst['__ANNOUNCE_LIST_ADDRESS__'] = announce_list_address
 
-        message = TemplateSubst(my_subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.announce'))
-        utils.send_mail(message)
+            message = TemplateSubst(my_subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.announce'))
+            send_mail(message)
 
     if accepted_to_real_suite and upload.sourceful and cnf.find_b('Dinstall::CloseBugs'):
         for bug in upload.bugs: