Merge lp:~doanac/ubuntu-ci-services-itself/bug1283048 into lp:ubuntu-ci-services-itself

Proposed by Andy Doan
Status: Merged
Approved by: Francis Ginther
Approved revision: 269
Merged at revision: 270
Proposed branch: lp:~doanac/ubuntu-ci-services-itself/bug1283048
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 34 lines (+5/-1)
2 files modified
ppa-assigner/ppa_assigner/management/commands/clean_ppas.py (+1/-0)
ppa-assigner/ppa_assigner/models.py (+4/-1)
To merge this branch: bzr merge lp:~doanac/ubuntu-ci-services-itself/bug1283048
Reviewer Review Type Date Requested Status
Francis Ginther Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+207998@code.launchpad.net

Commit message

allows the ppa-assigner to automatically keep the configured list of PPAs in sync.

We have an API for this, but we already run code in the background looking at PPAs, so lets remove the need for the user.

Description of the change

allows the ppa-assigner to automatically keep the configured list of PPAs in sync.

We have an API for this, but we already run code in the background looking at PPAs, so lets remove the need for the user.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:269
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/225/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/225/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ppa-assigner/ppa_assigner/management/commands/clean_ppas.py'
2--- ppa-assigner/ppa_assigner/management/commands/clean_ppas.py 2014-02-19 16:34:46 +0000
3+++ ppa-assigner/ppa_assigner/management/commands/clean_ppas.py 2014-02-24 19:18:02 +0000
4@@ -51,6 +51,7 @@
5 interval = options['interval']
6 try:
7 while True:
8+ PPA.populate_from_launchpad()
9 self.dirty_to_cleaning()
10 self.cleaning_to_available()
11 if options['exit_early']:
12
13=== modified file 'ppa-assigner/ppa_assigner/models.py'
14--- ppa-assigner/ppa_assigner/models.py 2014-02-19 16:34:46 +0000
15+++ ppa-assigner/ppa_assigner/models.py 2014-02-24 19:18:02 +0000
16@@ -55,6 +55,9 @@
17
18 @staticmethod
19 def _merge_ppas(lp_ppas):
20+ # note: LP will throttle calls to list PPAs. So you can occassionally
21+ # add a PPA, and not see it update for the first few calls to this
22+ # method, but it will eventually get in sync
23 model_ppas = set([x.name for x in PPA.objects.all()])
24 add = lp_ppas - model_ppas
25 remove = model_ppas - lp_ppas
26@@ -63,7 +66,7 @@
27 for x in add:
28 PPA.objects.create(name=x, ticket_id=0)
29
30- logging.info('removing ppas: %r', add)
31+ logging.info('removing ppas: %r', remove)
32 for x in remove:
33 ppa = PPA.objects.get(name=x)
34 if ppa.state == PPA.RESERVED:

Subscribers

People subscribed via source and target branches