Merge lp:~stevenk/launchpad/notify-announce-list into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 13153
Proposed branch: lp:~stevenk/launchpad/notify-announce-list
Merge into: lp:launchpad
Diff against target: 524 lines (+56/-84)
17 files modified
lib/lp/archiveuploader/nascentupload.py (+0/-1)
lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+7/-1)
lib/lp/archiveuploader/tests/nascentupload-ddebs.txt (+2/-2)
lib/lp/archiveuploader/tests/test_uploadprocessor.py (+1/-1)
lib/lp/archiveuploader/tests/upload-karma.txt (+2/-2)
lib/lp/archiveuploader/tests/uploadpolicy.txt (+0/-2)
lib/lp/archiveuploader/uploadpolicy.py (+0/-9)
lib/lp/soyuz/adapters/notification.py (+15/-13)
lib/lp/soyuz/browser/queue.py (+1/-1)
lib/lp/soyuz/doc/distroseriesqueue-notify.txt (+4/-7)
lib/lp/soyuz/doc/distroseriesqueue.txt (+1/-1)
lib/lp/soyuz/interfaces/queue.py (+2/-5)
lib/lp/soyuz/model/queue.py (+6/-7)
lib/lp/soyuz/scripts/queue.py (+8/-17)
lib/lp/soyuz/scripts/tests/test_queue.py (+4/-5)
lib/lp/soyuz/tests/test_packageupload.py (+1/-2)
scripts/ftpmaster-tools/queue (+2/-8)
To merge this branch: bzr merge lp:~stevenk/launchpad/notify-announce-list
Reviewer Review Type Date Requested Status
William Grant Approve
Review via email: mp+63067@code.launchpad.net

Commit message

[r=wgrant][no-qa] Drop announce_list from notify() and PackageUpload.acceptFromQueue(), leaving it up to notify() internals.

Description of the change

Drop announce_list from the arguments for notify() and PackageUpload.acceptFromQueue().

This now leaves announce notification up to the IDistroSeries.changeslist property, and the notification code itself if it will send it. There was a little test fallout, but nothing too horrid.

I have discussed this change with Julian Edwards before implementing, and he agreed it was a good change.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

133 + if (action == 'accepted' and distroseries.changeslist and
134 + not archive.is_ppa and pocket != PackagePublishingPocket.BACKPORTS
135 + and not (pocket == PackagePublishingPocket.SECURITY and spr is None)
136 + and not is_auto_sync_upload(
137 + spr, bprs, pocket, changes['Changed-By'])):

The ands were consistently at the end of each line. Either is OK, but not both at once please.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/archiveuploader/nascentupload.py'
--- lib/lp/archiveuploader/nascentupload.py 2011-05-20 08:04:19 +0000
+++ lib/lp/archiveuploader/nascentupload.py 2011-06-02 09:53:33 +0000
@@ -855,7 +855,6 @@
855 changes_file_object = open(self.changes.filepath, "r")855 changes_file_object = open(self.changes.filepath, "r")
856 self.queue_root.notify(856 self.queue_root.notify(
857 summary_text=self.warning_message,857 summary_text=self.warning_message,
858 announce_list=self.policy.announcelist,
859 changes_file_object=changes_file_object,858 changes_file_object=changes_file_object,
860 logger=self.logger)859 logger=self.logger)
861 changes_file_object.close()860 changes_file_object.close()
862861
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-announcements.txt'
--- lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2011-05-27 06:17:14 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2011-06-02 09:53:33 +0000
@@ -655,11 +655,17 @@
655 DEBUG Body:655 DEBUG Body:
656 DEBUG bar (1.0-6) breezy; urgency=low656 DEBUG bar (1.0-6) breezy; urgency=low
657 ...657 ...
658 DEBUG No announcement sent658 DEBUG Announcing to hoary-announce@lists.ubuntu.com
659 ...659 ...
660 DEBUG You are receiving this email because you are the uploader, maintainer660 DEBUG You are receiving this email because you are the uploader, maintainer
661 or661 or
662 DEBUG signer of the above package.662 DEBUG signer of the above package.
663 DEBUG Would have sent a mail:
664 DEBUG Subject: [ubuntu/hoary] bar 1.0-6 (Accepted)
665 DEBUG Sender: Celso Providelo <cprov@ubuntu.com>
666 DEBUG Recipients: hoary-announce@lists.ubuntu.com
667 DEBUG Bcc: Root <root@localhost>, bar_derivatives@packages.qa.debian.org
668 ...
663669
664No emails generated:670No emails generated:
665671
666672
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-ddebs.txt'
--- lib/lp/archiveuploader/tests/nascentupload-ddebs.txt 2011-03-03 00:43:44 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-ddebs.txt 2011-06-02 09:53:33 +0000
@@ -39,7 +39,7 @@
39We don't really care where the source ends up, so we just accept the39We don't really care where the source ends up, so we just accept the
40default overrides. It is now pending publication.40default overrides. It is now pending publication.
4141
42 >>> src.queue_root.acceptFromQueue("announce@example.com")42 >>> src.queue_root.acceptFromQueue()
43 >>> print src.queue_root.status.name43 >>> print src.queue_root.status.name
44 DONE44 DONE
4545
@@ -91,7 +91,7 @@
9191
92 >>> bin.queue_root.overrideBinaries(main, devel, None, [main, universe])92 >>> bin.queue_root.overrideBinaries(main, devel, None, [main, universe])
93 True93 True
94 >>> bin.queue_root.acceptFromQueue('announce@example.com')94 >>> bin.queue_root.acceptFromQueue()
9595
96 >>> print bin.queue_root.status.name96 >>> print bin.queue_root.status.name
97 ACCEPTED97 ACCEPTED
9898
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2011-05-20 03:28:24 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2011-06-02 09:53:33 +0000
@@ -1438,7 +1438,7 @@
1438 # just-uploaded changesfile from librarian.1438 # just-uploaded changesfile from librarian.
1439 self.layer.txn.commit()1439 self.layer.txn.commit()
14401440
1441 upload.queue_root.acceptFromQueue('announce@ubuntu.com')1441 upload.queue_root.acceptFromQueue()
14421442
1443 # 'biscuit_1.0-2' building on i386 get accepted and published.1443 # 'biscuit_1.0-2' building on i386 get accepted and published.
1444 packager.buildVersion('1.0-2', suite=self.breezy.name, arch="i386")1444 packager.buildVersion('1.0-2', suite=self.breezy.name, arch="i386")
14451445
=== modified file 'lib/lp/archiveuploader/tests/upload-karma.txt'
--- lib/lp/archiveuploader/tests/upload-karma.txt 2010-12-02 16:13:51 +0000
+++ lib/lp/archiveuploader/tests/upload-karma.txt 2011-06-02 09:53:33 +0000
@@ -33,7 +33,7 @@
3333
34 >>> from canonical.database.sqlbase import commit34 >>> from canonical.database.sqlbase import commit
35 >>> commit()35 >>> commit()
36 >>> bar_src.queue_root.acceptFromQueue("announce@example.com")36 >>> bar_src.queue_root.acceptFromQueue()
37 Karma added: action=distributionuploadaccepted, distribution=ubuntu37 Karma added: action=distributionuploadaccepted, distribution=ubuntu
3838
39As can be seen, karma was added for the package creator.39As can be seen, karma was added for the package creator.
@@ -55,7 +55,7 @@
55 >>> key = getUtility(IGPGKeySet).getGPGKeysForPeople([name16])[0]55 >>> key = getUtility(IGPGKeySet).getGPGKeysForPeople([name16])[0]
56 >>> removeSecurityProxy(foo_src.queue_root).signing_key = key56 >>> removeSecurityProxy(foo_src.queue_root).signing_key = key
57 >>> commit()57 >>> commit()
58 >>> foo_src.queue_root.acceptFromQueue("announce@example.com")58 >>> foo_src.queue_root.acceptFromQueue()
59 Karma added: action=distributionuploadaccepted, distribution=ubuntu59 Karma added: action=distributionuploadaccepted, distribution=ubuntu
60 Karma added: action=sponsoruploadaccepted, distribution=ubuntu60 Karma added: action=sponsoruploadaccepted, distribution=ubuntu
6161
6262
=== modified file 'lib/lp/archiveuploader/tests/uploadpolicy.txt'
--- lib/lp/archiveuploader/tests/uploadpolicy.txt 2010-10-18 22:24:59 +0000
+++ lib/lp/archiveuploader/tests/uploadpolicy.txt 2011-06-02 09:53:33 +0000
@@ -71,8 +71,6 @@
71 >>> buildd_policy.setDistroSeriesAndPocket("hoary")71 >>> buildd_policy.setDistroSeriesAndPocket("hoary")
72 >>> print buildd_policy.distroseries.name72 >>> print buildd_policy.distroseries.name
73 hoary73 hoary
74 >>> print buildd_policy.announcelist
75 hoary-changes@ubuntu.com
7674
77Policies can make decisions based on whether or not they want to75Policies can make decisions based on whether or not they want to
78approve an upload automatically (I.E. move it straight to ACCEPTED76approve an upload automatically (I.E. move it straight to ACCEPTED
7977
=== modified file 'lib/lp/archiveuploader/uploadpolicy.py'
--- lib/lp/archiveuploader/uploadpolicy.py 2011-05-27 19:53:20 +0000
+++ lib/lp/archiveuploader/uploadpolicy.py 2011-06-02 09:53:33 +0000
@@ -150,15 +150,6 @@
150 if self.archive is None:150 if self.archive is None:
151 self.archive = self.distroseries.main_archive151 self.archive = self.distroseries.main_archive
152152
153 @property
154 def announcelist(self):
155 """Return the announcement list address."""
156 announce_list = getattr(self.options, 'announcelist', None)
157 if (announce_list is None and
158 getattr(self, 'distroseries', None) is not None):
159 announce_list = self.distroseries.changeslist
160 return announce_list
161
162 def checkUpload(self, upload):153 def checkUpload(self, upload):
163 """Mandatory policy checks on NascentUploads."""154 """Mandatory policy checks on NascentUploads."""
164 if self.archive.is_copy:155 if self.archive.is_copy:
165156
=== modified file 'lib/lp/soyuz/adapters/notification.py'
--- lib/lp/soyuz/adapters/notification.py 2011-05-27 21:12:25 +0000
+++ lib/lp/soyuz/adapters/notification.py 2011-06-02 09:53:33 +0000
@@ -115,9 +115,8 @@
115115
116116
117def notify(blamer, spr, bprs, customfiles, archive, distroseries, pocket,117def notify(blamer, spr, bprs, customfiles, archive, distroseries, pocket,
118 announce_list=None, summary_text=None, changes=None,118 summary_text=None, changes=None, changesfile_content=None,
119 changesfile_content=None, changesfile_object=None, action=None,119 changesfile_object=None, action=None, dry_run=False, logger=None):
120 dry_run=False, logger=None):
121 """Notify about 120 """Notify about
122121
123 :param blamer: The `IPerson` who is to blame for this notification.122 :param blamer: The `IPerson` who is to blame for this notification.
@@ -127,7 +126,6 @@
127 :param archive: The target `IArchive`.126 :param archive: The target `IArchive`.
128 :param distroseries: The target `IDistroSeries`.127 :param distroseries: The target `IDistroSeries`.
129 :param pocket: The target `PackagePublishingPocket`.128 :param pocket: The target `PackagePublishingPocket`.
130 :param announce_list: Where to announce the upload.
131 :param summary_text: The summary of the notification.129 :param summary_text: The summary of the notification.
132 :param changes: A dictionary of the parsed changes file.130 :param changes: A dictionary of the parsed changes file.
133 :param changesfile_content: The raw content of the changes file, so it131 :param changesfile_content: The raw content of the changes file, so it
@@ -203,7 +201,7 @@
203 spr, bprs, customfiles, archive, distroseries, pocket, action)201 spr, bprs, customfiles, archive, distroseries, pocket, action)
204 body = assemble_body(202 body = assemble_body(
205 blamer, spr, archive, distroseries, summarystring, changes,203 blamer, spr, archive, distroseries, summarystring, changes,
206 action, announce_list)204 action)
207 send_mail(205 send_mail(
208 spr, archive, recipients, subject, body, dry_run,206 spr, archive, recipients, subject, body, dry_run,
209 changesfile_content=changesfile_content,207 changesfile_content=changesfile_content,
@@ -215,10 +213,12 @@
215 # If we're sending an acceptance notification for a non-PPA upload,213 # If we're sending an acceptance notification for a non-PPA upload,
216 # announce if possible. Avoid announcing backports, binary-only214 # announce if possible. Avoid announcing backports, binary-only
217 # security uploads, or autosync uploads.215 # security uploads, or autosync uploads.
218 if (action == 'accepted' and announce_list and not archive.is_ppa and216 if (action == 'accepted' and distroseries.changeslist
219 pocket != PackagePublishingPocket.BACKPORTS and217 and not archive.is_ppa
220 not (pocket == PackagePublishingPocket.SECURITY and spr is None) and218 and pocket != PackagePublishingPocket.BACKPORTS
221 not is_auto_sync_upload(spr, bprs, pocket, changes['Changed-By'])):219 and not (pocket == PackagePublishingPocket.SECURITY and spr is None)
220 and not is_auto_sync_upload(
221 spr, bprs, pocket, changes['Changed-By'])):
222 from_addr = sanitize_string(changes['Changed-By'])222 from_addr = sanitize_string(changes['Changed-By'])
223 name = None223 name = None
224 bcc_addr = None224 bcc_addr = None
@@ -230,11 +230,12 @@
230 bcc_addr = '%s_derivatives@packages.qa.debian.org' % name230 bcc_addr = '%s_derivatives@packages.qa.debian.org' % name
231231
232 build_and_send_mail(232 build_and_send_mail(
233 'announcement', [str(announce_list)], from_addr, bcc_addr)233 'announcement', [str(distroseries.changeslist)], from_addr,
234 bcc_addr)
234235
235236
236def assemble_body(blamer, spr, archive, distroseries, summary, changes,237def assemble_body(blamer, spr, archive, distroseries, summary, changes,
237 action, announce_list):238 action):
238 """Assemble the e-mail notification body."""239 """Assemble the e-mail notification body."""
239 information = {240 information = {
240 'STATUS': ACTION_DESCRIPTIONS[action],241 'STATUS': ACTION_DESCRIPTIONS[action],
@@ -262,8 +263,9 @@
262 if action == 'unapproved':263 if action == 'unapproved':
263 information['SUMMARY'] += (264 information['SUMMARY'] += (
264 "\nThis upload awaits approval by a distro manager\n")265 "\nThis upload awaits approval by a distro manager\n")
265 if announce_list:266 if distroseries.changeslist:
266 information['ANNOUNCE'] = "Announcing to %s" % announce_list267 information['ANNOUNCE'] = "Announcing to %s" % (
268 distroseries.changeslist)
267 if blamer is not None:269 if blamer is not None:
268 signer_signature = '%s <%s>' % (270 signer_signature = '%s <%s>' % (
269 blamer.displayname, blamer.preferredemail.email)271 blamer.displayname, blamer.preferredemail.email)
270272
=== modified file 'lib/lp/soyuz/browser/queue.py'
--- lib/lp/soyuz/browser/queue.py 2010-08-25 11:00:07 +0000
+++ lib/lp/soyuz/browser/queue.py 2011-06-02 09:53:33 +0000
@@ -400,7 +400,7 @@
400400
401 def queue_action_accept(self, queue_item):401 def queue_action_accept(self, queue_item):
402 """Reject the queue item passed."""402 """Reject the queue item passed."""
403 queue_item.acceptFromQueue(announce_list=self.context.changeslist)403 queue_item.acceptFromQueue()
404404
405 def queue_action_reject(self, queue_item):405 def queue_action_reject(self, queue_item):
406 """Accept the queue item passed."""406 """Accept the queue item passed."""
407407
=== modified file 'lib/lp/soyuz/doc/distroseriesqueue-notify.txt'
--- lib/lp/soyuz/doc/distroseriesqueue-notify.txt 2011-05-27 06:17:14 +0000
+++ lib/lp/soyuz/doc/distroseriesqueue-notify.txt 2011-06-02 09:53:33 +0000
@@ -43,7 +43,6 @@
43 >>> changes_file = open(changes_file_path,'r')43 >>> changes_file = open(changes_file_path,'r')
44 >>> from lp.services.log.logger import FakeLogger44 >>> from lp.services.log.logger import FakeLogger
45 >>> netapplet_upload.notify(45 >>> netapplet_upload.notify(
46 ... announce_list="announcelist@canonical.com",
47 ... changes_file_object=changes_file, logger=FakeLogger())46 ... changes_file_object=changes_file, logger=FakeLogger())
48 DEBUG Building recipients list.47 DEBUG Building recipients list.
49 DEBUG Changes file is unsigned, adding changer as recipient48 DEBUG Changes file is unsigned, adding changer as recipient
@@ -116,7 +115,6 @@
116 >>> changes_file = open(changes_file_path,'r')115 >>> changes_file = open(changes_file_path,'r')
117 >>> netapplet_upload.setAccepted()116 >>> netapplet_upload.setAccepted()
118 >>> netapplet_upload.notify(117 >>> netapplet_upload.notify(
119 ... announce_list="announcelist@canonical.com",
120 ... changes_file_object=changes_file, logger=FakeLogger())118 ... changes_file_object=changes_file, logger=FakeLogger())
121 DEBUG Building recipients list.119 DEBUG Building recipients list.
122 ...120 ...
@@ -124,7 +122,7 @@
124 ...122 ...
125 DEBUG Recipients: Foo Bar <foo.bar@canonical.com>, Daniel Silverstone <daniel.silverstone@canonical.com>123 DEBUG Recipients: Foo Bar <foo.bar@canonical.com>, Daniel Silverstone <daniel.silverstone@canonical.com>
126 ...124 ...
127 DEBUG Announcing to announcelist@canonical.com125 DEBUG Announcing to autotest_changes@ubuntu.com
128 ...126 ...
129 DEBUG Sent a mail:127 DEBUG Sent a mail:
130 ...128 ...
@@ -137,10 +135,10 @@
137 2135 2
138136
139The mail 'To:' addresses contain the signer and the changer's email. The137The mail 'To:' addresses contain the signer and the changer's email. The
140announcement email contains the argument specified for "announce_list".138announcement email contains the serieses changeslist.
141139
142 >>> [msg['To'] for msg in msgs]140 >>> [msg['To'] for msg in msgs]
143 ['Foo Bar <foo.bar@canonical.com>,\n\tDaniel Silverstone <daniel.silverstone@canonical.com>', 'announcelist@canonical.com']141 ['Foo Bar <foo.bar@canonical.com>,\n\tDaniel Silverstone <daniel.silverstone@canonical.com>', 'autotest_changes@ubuntu.com']
144142
145The mail 'Bcc:' address is the uploader. The announcement has the uploader143The mail 'Bcc:' address is the uploader. The announcement has the uploader
146and the Debian derivatives address for the package uploaded.144and the Debian derivatives address for the package uploaded.
@@ -185,8 +183,7 @@
185 >>> fillLibrarianFile(1, content=changes_file.read())183 >>> fillLibrarianFile(1, content=changes_file.read())
186 >>> changes_file.close()184 >>> changes_file.close()
187 >>> netapplet_upload.setNew()185 >>> netapplet_upload.setNew()
188 >>> netapplet_upload.notify(announce_list="announcelist@canonical.com",186 >>> netapplet_upload.notify(logger=FakeLogger())
189 ... logger=FakeLogger())
190 DEBUG Building recipients list.187 DEBUG Building recipients list.
191 ...188 ...
192 DEBUG Sent a mail:189 DEBUG Sent a mail:
193190
=== modified file 'lib/lp/soyuz/doc/distroseriesqueue.txt'
--- lib/lp/soyuz/doc/distroseriesqueue.txt 2011-01-17 21:51:09 +0000
+++ lib/lp/soyuz/doc/distroseriesqueue.txt 2011-06-02 09:53:33 +0000
@@ -982,7 +982,7 @@
982 >>> insertFakeChangesFile(items[1].changesfile.id)982 >>> insertFakeChangesFile(items[1].changesfile.id)
983 >>> insertFakeChangesFile(items[3].changesfile.id)983 >>> insertFakeChangesFile(items[3].changesfile.id)
984 >>> try:984 >>> try:
985 ... items[1].acceptFromQueue('announce@example.com')985 ... items[1].acceptFromQueue()
986 ... except QueueInconsistentStateError, e:986 ... except QueueInconsistentStateError, e:
987 ... print 'FAILED'987 ... print 'FAILED'
988 ... else:988 ... else:
989989
=== modified file 'lib/lp/soyuz/interfaces/queue.py'
--- lib/lp/soyuz/interfaces/queue.py 2011-05-25 08:16:52 +0000
+++ lib/lp/soyuz/interfaces/queue.py 2011-06-02 09:53:33 +0000
@@ -238,7 +238,7 @@
238 has no sources associated to it.238 has no sources associated to it.
239 """239 """
240240
241 def acceptFromQueue(announce_list, logger=None, dry_run=False):241 def acceptFromQueue(logger=None, dry_run=False):
242 """Call setAccepted, do a syncUpdate, and send notification email.242 """Call setAccepted, do a syncUpdate, and send notification email.
243243
244 * Grant karma to people involved with the upload.244 * Grant karma to people involved with the upload.
@@ -280,15 +280,12 @@
280 committed to have some updates actually written to the database.280 committed to have some updates actually written to the database.
281 """281 """
282282
283 def notify(announce_list=None, summary_text=None,283 def notify(summary_text=None, changes_file_object=None, logger=None):
284 changes_file_object=None, logger=None):
285 """Notify by email when there is a new distroseriesqueue entry.284 """Notify by email when there is a new distroseriesqueue entry.
286285
287 This will send new, accept, announce and rejection messages as286 This will send new, accept, announce and rejection messages as
288 appropriate.287 appropriate.
289288
290 :param announce_list: The email address of the distro announcements
291
292 :param summary_text: Any additional text to append to the auto-289 :param summary_text: Any additional text to append to the auto-
293 generated summary. This is also the only text used if there is290 generated summary. This is also the only text used if there is
294 a rejection message generated.291 a rejection message generated.
295292
=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py 2011-05-27 07:29:08 +0000
+++ lib/lp/soyuz/model/queue.py 2011-06-02 09:53:33 +0000
@@ -392,7 +392,7 @@
392 self._closeBugs(changesfile_path, logger)392 self._closeBugs(changesfile_path, logger)
393 self._giveKarma()393 self._giveKarma()
394394
395 def acceptFromQueue(self, announce_list, logger=None, dry_run=False):395 def acceptFromQueue(self, logger=None, dry_run=False):
396 """See `IPackageUpload`."""396 """See `IPackageUpload`."""
397 assert not self.is_delayed_copy, 'Cannot process delayed copies.'397 assert not self.is_delayed_copy, 'Cannot process delayed copies.'
398398
@@ -402,7 +402,7 @@
402 # is pulled from the librarian which are stripped of their402 # is pulled from the librarian which are stripped of their
403 # signature just before being stored.403 # signature just before being stored.
404 self.notify(404 self.notify(
405 announce_list=announce_list, logger=logger, dry_run=dry_run,405 logger=logger, dry_run=dry_run,
406 changes_file_object=changes_file_object)406 changes_file_object=changes_file_object)
407 self.syncUpdate()407 self.syncUpdate()
408408
@@ -633,7 +633,6 @@
633 changes_file_object = StringIO.StringIO(633 changes_file_object = StringIO.StringIO(
634 changes_file.read())634 changes_file.read())
635 self.notify(635 self.notify(
636 announce_list=self.distroseries.changeslist,
637 changes_file_object=changes_file_object,636 changes_file_object=changes_file_object,
638 logger=logger)637 logger=logger)
639 self.syncUpdate()638 self.syncUpdate()
@@ -683,8 +682,8 @@
683 # and uploading to any archive as the signer.682 # and uploading to any archive as the signer.
684 return changes, strip_pgp_signature(changes_content).splitlines(True)683 return changes, strip_pgp_signature(changes_content).splitlines(True)
685684
686 def notify(self, announce_list=None, summary_text=None,685 def notify(self, summary_text=None, changes_file_object=None,
687 changes_file_object=None, logger=None, dry_run=False):686 logger=None, dry_run=False):
688 """See `IPackageUpload`."""687 """See `IPackageUpload`."""
689 status_action = {688 status_action = {
690 PackageUploadStatus.NEW: 'new',689 PackageUploadStatus.NEW: 'new',
@@ -704,8 +703,8 @@
704 signer = None703 signer = None
705 notify(704 notify(
706 signer, self.sourcepackagerelease, self.builds, self.customfiles,705 signer, self.sourcepackagerelease, self.builds, self.customfiles,
707 self.archive, self.distroseries, self.pocket, announce_list,706 self.archive, self.distroseries, self.pocket, summary_text,
708 summary_text, changes, changesfile_content, changes_file_object,707 changes, changesfile_content, changes_file_object,
709 status_action[self.status], dry_run, logger)708 status_action[self.status], dry_run, logger)
710709
711 def _isPersonUploader(self, person):710 def _isPersonUploader(self, person):
712711
=== modified file 'lib/lp/soyuz/scripts/queue.py'
--- lib/lp/soyuz/scripts/queue.py 2010-09-27 20:47:58 +0000
+++ lib/lp/soyuz/scripts/queue.py 2011-06-02 09:53:33 +0000
@@ -79,8 +79,7 @@
7979
80 def __init__(self, distribution_name, suite_name, queue, terms,80 def __init__(self, distribution_name, suite_name, queue, terms,
81 component_name, section_name, priority_name,81 component_name, section_name, priority_name,
82 announcelist, display, no_mail=True, exact_match=False,82 display, no_mail=True, exact_match=False, log=None):
83 log=None):
84 """Initialises passed variables. """83 """Initialises passed variables. """
85 self.terms = terms84 self.terms = terms
86 # Some actions have addtional commands at the start of the terms85 # Some actions have addtional commands at the start of the terms
@@ -94,7 +93,6 @@
94 self.no_mail = no_mail93 self.no_mail = no_mail
95 self.distribution_name = distribution_name94 self.distribution_name = distribution_name
96 self.suite_name = suite_name95 self.suite_name = suite_name
97 self.announcelist = announcelist
98 self.default_sender = "%s <%s>" % (96 self.default_sender = "%s <%s>" % (
99 config.uploader.default_sender_name,97 config.uploader.default_sender_name,
100 config.uploader.default_sender_address)98 config.uploader.default_sender_address)
@@ -112,7 +110,7 @@
112 pocket=self.pocket)110 pocket=self.pocket)
113111
114 def setDefaultContext(self):112 def setDefaultContext(self):
115 """Set default distribuiton, distroseries, announcelist."""113 """Set default distribuiton, distroseries."""
116 # if not found defaults to 'ubuntu'114 # if not found defaults to 'ubuntu'
117115
118 # Avoid circular imports.116 # Avoid circular imports.
@@ -140,9 +138,6 @@
140 self.distroseries = self.distribution.currentseries138 self.distroseries = self.distribution.currentseries
141 self.pocket = PackagePublishingPocket.RELEASE139 self.pocket = PackagePublishingPocket.RELEASE
142140
143 if not self.announcelist:
144 self.announcelist = self.distroseries.changeslist
145
146 def initialize(self):141 def initialize(self):
147 """Builds a list of affected records based on the filter argument."""142 """Builds a list of affected records based on the filter argument."""
148 self.setDefaultContext()143 self.setDefaultContext()
@@ -483,8 +478,7 @@
483 self.display('Accepting %s' % queue_item.displayname)478 self.display('Accepting %s' % queue_item.displayname)
484 try:479 try:
485 queue_item.acceptFromQueue(480 queue_item.acceptFromQueue(
486 announce_list=self.announcelist, logger=self.log,481 logger=self.log, dry_run=self.no_mail)
487 dry_run=self.no_mail)
488 except QueueInconsistentStateError, info:482 except QueueInconsistentStateError, info:
489 self.display('** %s could not be accepted due to %s'483 self.display('** %s could not be accepted due to %s'
490 % (queue_item.displayname, info))484 % (queue_item.displayname, info))
@@ -522,8 +516,7 @@
522516
523 def __init__(self, distribution_name, suite_name, queue, terms,517 def __init__(self, distribution_name, suite_name, queue, terms,
524 component_name, section_name, priority_name,518 component_name, section_name, priority_name,
525 announcelist, display, no_mail=True, exact_match=False,519 display, no_mail=True, exact_match=False, log=None):
526 log=None):
527 """Constructor for QueueActionOverride."""520 """Constructor for QueueActionOverride."""
528521
529 # This exists so that self.terms_start_index can be set as this action522 # This exists so that self.terms_start_index can be set as this action
@@ -532,8 +525,8 @@
532 # over-ride.525 # over-ride.
533 QueueAction.__init__(self, distribution_name, suite_name, queue,526 QueueAction.__init__(self, distribution_name, suite_name, queue,
534 terms, component_name, section_name,527 terms, component_name, section_name,
535 priority_name, announcelist, display,528 priority_name, display, no_mail=True,
536 no_mail=True, exact_match=False, log=log)529 exact_match=False, log=log)
537 self.terms_start_index = 1530 self.terms_start_index = 1
538 self.overrides_performed = 0531 self.overrides_performed = 0
539532
@@ -665,12 +658,11 @@
665 """A wrapper for queue_action classes."""658 """A wrapper for queue_action classes."""
666659
667 def __init__(self, queue, distribution_name, suite_name,660 def __init__(self, queue, distribution_name, suite_name,
668 announcelist, no_mail, component_name, section_name,661 no_mail, component_name, section_name, priority_name,
669 priority_name, display=default_display, log=None):662 display=default_display, log=None):
670 self.queue = queue663 self.queue = queue
671 self.distribution_name = distribution_name664 self.distribution_name = distribution_name
672 self.suite_name = suite_name665 self.suite_name = suite_name
673 self.announcelist = announcelist
674 self.no_mail = no_mail666 self.no_mail = no_mail
675 self.component_name = component_name667 self.component_name = component_name
676 self.section_name = section_name668 self.section_name = section_name
@@ -701,7 +693,6 @@
701 queue_action = queue_action_class(693 queue_action = queue_action_class(
702 distribution_name=self.distribution_name,694 distribution_name=self.distribution_name,
703 suite_name=self.suite_name,695 suite_name=self.suite_name,
704 announcelist=self.announcelist,
705 queue=self.queue,696 queue=self.queue,
706 no_mail=self.no_mail,697 no_mail=self.no_mail,
707 display=self.display,698 display=self.display,
708699
=== modified file 'lib/lp/soyuz/scripts/tests/test_queue.py'
--- lib/lp/soyuz/scripts/tests/test_queue.py 2011-01-17 21:51:09 +0000
+++ lib/lp/soyuz/scripts/tests/test_queue.py 2011-06-02 09:53:33 +0000
@@ -91,10 +91,9 @@
91 self.test_output.append(text)91 self.test_output.append(text)
9292
93 def execute_command(self, argument, queue_name='new', no_mail=True,93 def execute_command(self, argument, queue_name='new', no_mail=True,
94 distribution_name='ubuntu',announcelist=None,94 distribution_name='ubuntu', component_name=None,
95 component_name=None, section_name=None,95 section_name=None, priority_name=None,
96 priority_name=None, suite_name='breezy-autotest',96 suite_name='breezy-autotest', quiet=True):
97 quiet=True):
98 """Helper method to execute a queue command.97 """Helper method to execute a queue command.
9998
100 Initialise output buffer and execute a command according99 Initialise output buffer and execute a command according
@@ -105,7 +104,7 @@
105 self.test_output = []104 self.test_output = []
106 queue = name_queue_map[queue_name]105 queue = name_queue_map[queue_name]
107 runner = CommandRunner(106 runner = CommandRunner(
108 queue, distribution_name, suite_name, announcelist, no_mail,107 queue, distribution_name, suite_name, no_mail,
109 component_name, section_name, priority_name,108 component_name, section_name, priority_name,
110 display=self._test_display)109 display=self._test_display)
111110
112111
=== modified file 'lib/lp/soyuz/tests/test_packageupload.py'
--- lib/lp/soyuz/tests/test_packageupload.py 2011-05-25 07:09:27 +0000
+++ lib/lp/soyuz/tests/test_packageupload.py 2011-06-02 09:53:33 +0000
@@ -63,8 +63,7 @@
63 delayed_copy = self.createEmptyDelayedCopy()63 delayed_copy = self.createEmptyDelayedCopy()
64 self.assertRaisesWithContent(64 self.assertRaisesWithContent(
65 AssertionError,65 AssertionError,
66 'Cannot process delayed copies.',66 'Cannot process delayed copies.', delayed_copy.acceptFromQueue)
67 delayed_copy.acceptFromQueue, 'some-announce-list')
6867
69 def test_acceptFromCopy_refuses_empty_copies(self):68 def test_acceptFromCopy_refuses_empty_copies(self):
70 # Empty delayed-copies cannot be accepted.69 # Empty delayed-copies cannot be accepted.
7170
=== modified file 'scripts/ftpmaster-tools/queue'
--- scripts/ftpmaster-tools/queue 2010-04-27 19:48:39 +0000
+++ scripts/ftpmaster-tools/queue 2011-06-02 09:53:33 +0000
@@ -59,12 +59,6 @@
59 default=False,59 default=False,
60 help="Ignore errors when performing a list of commands.")60 help="Ignore errors when performing a list of commands.")
6161
62 parser.add_option("-A", "--announcelist",
63 dest="announcelist", metavar="ANNOUNCELIST",
64 default=None,
65 help=("Overrides the announcement list for accepts, "
66 "defaults to the distribution 'changeslist'"))
67
68 parser.add_option("-f", "--file", metavar="FILE", default=None,62 parser.add_option("-f", "--file", metavar="FILE", default=None,
69 help="file containing a sequence of command lines.")63 help="file containing a sequence of command lines.")
7064
@@ -98,8 +92,8 @@
9892
99 cmd_runner = CommandRunner(93 cmd_runner = CommandRunner(
100 queue, options.distribution_name, options.suite_name,94 queue, options.distribution_name, options.suite_name,
101 options.announcelist, no_mail, options.component_name,95 no_mail, options.component_name, options.section_name,
102 options.section_name, options.priority_name, log=log)96 options.priority_name, log=log)
10397
104 print ("Initialising connection to queue %s" % options.queue_name)98 print ("Initialising connection to queue %s" % options.queue_name)
10599