Merge lp:~julian-edwards/maas/boot_images_beat into lp:maas/trunk

Proposed by Julian Edwards on 2012-10-30
Status: Merged
Approved by: Julian Edwards on 2012-10-30
Approved revision: 1319
Merged at revision: 1319
Proposed branch: lp:~julian-edwards/maas/boot_images_beat
Merge into: lp:maas/trunk
Diff against target: 82 lines (+6/-17)
5 files modified
etc/celeryconfig.py (+0/-10)
etc/celeryconfig_cluster.py (+5/-0)
etc/celeryconfig_common.py (+0/-1)
src/provisioningserver/tasks.py (+1/-1)
src/provisioningserver/tests/test_tasks.py (+0/-5)
To merge this branch: bzr merge lp:~julian-edwards/maas/boot_images_beat
Reviewer Review Type Date Requested Status
Gavin Panella (community) 2012-10-30 Approve on 2012-10-30
Review via email: mp+132065@code.launchpad.net

Commit message

Move the report-boot-images celerybeat task from region to clusters, as that is now where this task runs.

To post a comment you must log in.
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/celeryconfig.py'
2--- etc/celeryconfig.py 2012-09-28 15:04:45 +0000
3+++ etc/celeryconfig.py 2012-10-30 11:20:31 +0000
4@@ -15,14 +15,9 @@
5
6 __metaclass__ = type
7
8-from datetime import timedelta
9-
10 import celeryconfig_common
11 from maas import import_settings
12
13-# Silence lint, this will be defined by celeryconfig_common.
14-WORKER_QUEUE_BOOT_IMAGES = None
15-
16 import_settings(celeryconfig_common)
17
18 try:
19@@ -34,9 +29,4 @@
20
21
22 CELERYBEAT_SCHEDULE = {
23- 'report-boot-images': {
24- 'task': 'provisioningserver.tasks.report_boot_images',
25- 'schedule': timedelta(minutes=5),
26- 'options': {'queue': WORKER_QUEUE_BOOT_IMAGES},
27- },
28 }
29
30=== modified file 'etc/celeryconfig_cluster.py'
31--- etc/celeryconfig_cluster.py 2012-10-11 10:47:57 +0000
32+++ etc/celeryconfig_cluster.py 2012-10-30 11:20:31 +0000
33@@ -40,4 +40,9 @@
34 'schedule': timedelta(minutes=1),
35 'options': {'queue': CLUSTER_UUID},
36 },
37+ 'report-boot-images': {
38+ 'task': 'provisioningserver.tasks.report_boot_images',
39+ 'schedule': timedelta(minutes=5),
40+ 'options': {'queue': CLUSTER_UUID},
41+ },
42 }
43
44=== modified file 'etc/celeryconfig_common.py'
45--- etc/celeryconfig_common.py 2012-10-23 12:48:31 +0000
46+++ etc/celeryconfig_common.py 2012-10-30 11:20:31 +0000
47@@ -54,7 +54,6 @@
48 CELERYBEAT_SCHEDULE_FILENAME = '/var/lib/maas/celerybeat-cluster-schedule'
49
50 WORKER_QUEUE_DNS = 'celery'
51-WORKER_QUEUE_BOOT_IMAGES = 'celery'
52
53 # Each cluster should have its own queue created automatically by Celery.
54 CELERY_CREATE_MISSING_QUEUES = True
55
56=== modified file 'src/provisioningserver/tasks.py'
57--- src/provisioningserver/tasks.py 2012-10-23 09:32:58 +0000
58+++ src/provisioningserver/tasks.py 2012-10-30 11:20:31 +0000
59@@ -335,7 +335,7 @@
60 # =====================================================================
61
62
63-@task(queue=celery_config.WORKER_QUEUE_BOOT_IMAGES)
64+@task
65 def report_boot_images():
66 """For master worker only: report available netboot images."""
67 boot_images.report_to_server()
68
69=== modified file 'src/provisioningserver/tests/test_tasks.py'
70--- src/provisioningserver/tests/test_tasks.py 2012-10-25 10:01:04 +0000
71+++ src/provisioningserver/tests/test_tasks.py 2012-10-30 11:20:31 +0000
72@@ -499,11 +499,6 @@
73 args, kwargs = MAASClient.post.call_args
74 self.assertItemsEqual([image], json.loads(kwargs['images']))
75
76- def test_report_boot_images_attached_to_boot_images_worker_queue(self):
77- self.assertEqual(
78- write_dns_config.queue,
79- celery_config.WORKER_QUEUE_BOOT_IMAGES)
80-
81
82 class TestTagTasks(PservTestCase):
83