Merge ~robru/britney/+git/britney2-ubuntu:fix-traceback into ~ubuntu-release/britney/+git/britney2-ubuntu:master

Proposed by Robert Bruce Park on 2017-03-09
Status: Merged
Merged at revision: 389f8624dde97ec5ae5b219d8d7b5b58248e234e
Proposed branch: ~robru/britney/+git/britney2-ubuntu:fix-traceback
Merge into: ~ubuntu-release/britney/+git/britney2-ubuntu:master
Diff against target: 40 lines (+5/-5)
1 file modified
britney2/policies/email.py (+5/-5)
Reviewer Review Type Date Requested Status
Steve Langasek 2017-03-09 Approve on 2017-03-09
Review via email: mp+319487@code.launchpad.net

Description of the Change

Stops returning None from a function where the caller expects strings.

And also round the age since people complained about that.

To post a comment you must log in.
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/britney2/policies/email.py b/britney2/policies/email.py
2index f335064..129d665 100644
3--- a/britney2/policies/email.py
4+++ b/britney2/policies/email.py
5@@ -31,7 +31,7 @@ Hi,
6
7 {source_name} {version} needs attention.
8
9-It has been stuck in {series}-proposed for {age} day{plural}.
10+It has been stuck in {series}-proposed for {age:.0f} day{plural}.
11
12 You either sponsored or uploaded this package, please investigate why it hasn't been approved for migration.
13
14@@ -64,14 +64,14 @@ def person_chooser(source):
15
16 def address_chooser(addresses):
17 """Prefer @ubuntu and @canonical addresses."""
18- first = None
19- canonical = None
20+ first = ''
21+ canonical = ''
22 for address in addresses:
23 if address.endswith('@ubuntu.com'):
24 return address
25 if address.endswith('@canonical.com'):
26 canonical = address
27- if first is None:
28+ if not first:
29 first = address
30 return canonical or first
31
32@@ -148,7 +148,7 @@ class EmailPolicy(BasePolicy, Rest):
33 # which is expected to happen when bileto runs britney.
34 except IndexError:
35 self.log('Email getPublishedSources IndexError (%s %s)' % (pkg, version))
36- return None
37+ return []
38 return self.scrape_gpg_emails(person_chooser(source))
39
40 def apply_policy_impl(self, email_info, suite, source_name, source_data_tdist, source_data_srcdist, excuse):

Subscribers

People subscribed via source and target branches