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
=== modified file 'ppa-assigner/ppa_assigner/management/commands/clean_ppas.py'
--- ppa-assigner/ppa_assigner/management/commands/clean_ppas.py 2014-02-19 16:34:46 +0000
+++ ppa-assigner/ppa_assigner/management/commands/clean_ppas.py 2014-02-24 19:18:02 +0000
@@ -51,6 +51,7 @@
51 interval = options['interval']51 interval = options['interval']
52 try:52 try:
53 while True:53 while True:
54 PPA.populate_from_launchpad()
54 self.dirty_to_cleaning()55 self.dirty_to_cleaning()
55 self.cleaning_to_available()56 self.cleaning_to_available()
56 if options['exit_early']:57 if options['exit_early']:
5758
=== modified file 'ppa-assigner/ppa_assigner/models.py'
--- ppa-assigner/ppa_assigner/models.py 2014-02-19 16:34:46 +0000
+++ ppa-assigner/ppa_assigner/models.py 2014-02-24 19:18:02 +0000
@@ -55,6 +55,9 @@
5555
56 @staticmethod56 @staticmethod
57 def _merge_ppas(lp_ppas):57 def _merge_ppas(lp_ppas):
58 # note: LP will throttle calls to list PPAs. So you can occassionally
59 # add a PPA, and not see it update for the first few calls to this
60 # method, but it will eventually get in sync
58 model_ppas = set([x.name for x in PPA.objects.all()])61 model_ppas = set([x.name for x in PPA.objects.all()])
59 add = lp_ppas - model_ppas62 add = lp_ppas - model_ppas
60 remove = model_ppas - lp_ppas63 remove = model_ppas - lp_ppas
@@ -63,7 +66,7 @@
63 for x in add:66 for x in add:
64 PPA.objects.create(name=x, ticket_id=0)67 PPA.objects.create(name=x, ticket_id=0)
6568
66 logging.info('removing ppas: %r', add)69 logging.info('removing ppas: %r', remove)
67 for x in remove:70 for x in remove:
68 ppa = PPA.objects.get(name=x)71 ppa = PPA.objects.get(name=x)
69 if ppa.state == PPA.RESERVED:72 if ppa.state == PPA.RESERVED:

Subscribers

People subscribed via source and target branches