Merge lp:~brian-murray/ubuntu-archive-tools/reject-comment-try into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 1187
Merged at revision: 1187
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/reject-comment-try
Merge into: lp:ubuntu-archive-tools
Diff against target: 22 lines (+6/-3)
1 file modified
sru-review (+6/-3)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/reject-comment-try
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+355342@code.launchpad.net

Description of the change

Don't keel over if one of the bugs we are trying to add a rejection comment on we can't actually comment on.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sru-review'
2--- sru-review 2018-09-19 10:30:03 +0000
3+++ sru-review 2018-09-19 12:51:55 +0000
4@@ -241,12 +241,15 @@
5
6
7 def reject_comment(launchpad, num, package, release, reason):
8- bug = launchpad.bugs[num]
9 text = ('An upload of %s to %s-proposed has been rejected from the upload '
10 'queue for the following reason: "%s".' %
11 (package, release, reason))
12- bug.newMessage(content=text,
13- subject='Proposed package upload rejected')
14+ try:
15+ bug = launchpad.bugs[num]
16+ bug.newMessage(content=text,
17+ subject='Proposed package upload rejected')
18+ except KeyError:
19+ print("LP: #%s may be private or a typo" % num)
20
21
22 if __name__ == '__main__':

Subscribers

People subscribed via source and target branches