[dak/master] dak/process_upload.py: only send mail to tracking server if accepted to real suite
---
dak/process_upload.py | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/dak/process_upload.py b/dak/process_upload.py
index 74229e2..bea8a10 100755
--- a/dak/process_upload.py
+++ b/dak/process_upload.py
@@ -302,24 +302,23 @@ def accept(directory, upload):
utils.send_mail(message)
# send mail to announce lists and tracking server
- subst = subst_for_upload(upload)
- announce = set()
- for suite in upload.final_suites:
- if suite.policy_queue is not None:
- continue
- announce.update(suite.announce or [])
- announce_address = ", ".join(announce)
-
- tracking = cnf.get('Dinstall::TrackingServer')
- if tracking and 'source' in upload.changes.architectures:
- announce_address = '{0}\nBcc: {1}@{2}'.format(announce_address, control['Source'], tracking)
+ if accepted_to_real_suite:
+ subst = subst_for_upload(upload)
+ announce = set()
+ for suite in upload.final_suites:
+ if suite.policy_queue is not None:
+ continue
+ announce.update(suite.announce or [])
+ announce_address = ", ".join(announce)
- subst['__ANNOUNCE_LIST_ADDRESS__'] = announce_address
+ tracking = cnf.get('Dinstall::TrackingServer')
+ if tracking and 'source' in upload.changes.architectures:
+ announce_address = '{0}\nBcc: {1}@{2}'.format(announce_address, control['Source'], tracking)
- message = utils.TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.announce'))
- utils.send_mail(message)
+ subst['__ANNOUNCE_LIST_ADDRESS__'] = announce_address
- del subst['__ANNOUNCE_LIST_ADDRESS__']
+ message = utils.TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'process-unchecked.announce'))
+ utils.send_mail(message)
# Only close bugs for uploads that were not redirected to a policy queue.
# process-policy will close bugs for those once they are accepted.
--
1.7.2.5
Reply to: