Merge lp:~stylesen/lava-scheduler/multinode into lp:lava-scheduler/multinode

Proposed by Senthil Kumaran S
Status: Merged
Approved by: Neil Williams
Approved revision: no longer in the source branch.
Merged at revision: 265
Proposed branch: lp:~stylesen/lava-scheduler/multinode
Merge into: lp:lava-scheduler/multinode
Diff against target: 43 lines (+6/-6)
1 file modified
lava_scheduler_daemon/dbjobsource.py (+6/-6)
To merge this branch: bzr merge lp:~stylesen/lava-scheduler/multinode
Reviewer Review Type Date Requested Status
Neil Williams Approve
Review via email: mp+176183@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Neil Williams (codehelp) wrote :

Looks good, approved.

review: Approve
Revision history for this message
Senthil Kumaran S (stylesen) wrote :

On Monday 22 July 2013 06:35 PM, Neil Williams wrote:
> Review: Approve
>
> Looks good, approved.

Even a simpler patch :)

=== modified file 'lava_scheduler_daemon/service.py'
--- lava_scheduler_daemon/service.py 2013-07-22 12:43:45 +0000
+++ lava_scheduler_daemon/service.py 2013-07-22 13:06:17 +0000
@@ -76,7 +76,7 @@
              self._cbCheckJobs).addErrback(catchall_errback(self.logger))

      def _cbCheckJobs(self, job_list):
- for job in job_list:
+ for job in set(job_list):
              new_job = NewJob(self.source, job, self.dispatcher,
self.reactor,
                               self.daemon_options)
              self.logger.info("Starting Job: %d " % job.id)

--
Senthil Kumaran
http://www.stylesen.org/
http://www.sasenthilkumaran.com/

265. By Neil Williams

Senthil Kumaran 2013-07-22 Return a unique set of job_list whenever asked for.
Senthil Kumaran 2013-07-22 Get unique job ids in the job list which
 restricts the same health check job being called more than once.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lava_scheduler_daemon/dbjobsource.py'
--- lava_scheduler_daemon/dbjobsource.py 2013-07-03 06:45:30 +0000
+++ lava_scheduler_daemon/dbjobsource.py 2013-07-22 12:46:28 +0000
@@ -107,10 +107,10 @@
107 """Gets the list of configured boards and checks which are the boards107 """Gets the list of configured boards and checks which are the boards
108 that require health check.108 that require health check.
109109
110 Returns JOB_LIST which is a list of health check jobs. If no health110 Returns JOB_LIST which is a set of health check jobs. If no health
111 check jobs are available returns an empty list.111 check jobs are available returns an empty set.
112 """112 """
113 job_list = []113 job_list = set()
114 configured_boards = [114 configured_boards = [
115 x.hostname for x in dispatcher_config.get_devices()]115 x.hostname for x in dispatcher_config.get_devices()]
116 boards = []116 boards = []
@@ -133,7 +133,7 @@
133 run_health_check = device.last_health_report_job.end_time < \133 run_health_check = device.last_health_report_job.end_time < \
134 datetime.datetime.now() - datetime.timedelta(days=1)134 datetime.datetime.now() - datetime.timedelta(days=1)
135 if run_health_check:135 if run_health_check:
136 job_list.append(self._getHealthCheckJobForBoard(device))136 job_list.add(self._getHealthCheckJobForBoard(device))
137 return job_list137 return job_list
138138
139 def _fix_device(self, device, job):139 def _fix_device(self, device, job):
@@ -181,7 +181,7 @@
181181
182 for job in jobs:182 for job in jobs:
183 if job.actual_device:183 if job.actual_device:
184 job_list.append(job)184 job_list.add(job)
185 elif job.requested_device:185 elif job.requested_device:
186 self.logger.debug("Checking Requested Device")186 self.logger.debug("Checking Requested Device")
187 devices = Device.objects.all().filter(187 devices = Device.objects.all().filter(
@@ -198,7 +198,7 @@
198 device = devices[0]198 device = devices[0]
199 job = self._fix_device(device, job)199 job = self._fix_device(device, job)
200 if job:200 if job:
201 job_list.append(job)201 job_list.add(job)
202202
203 return job_list203 return job_list
204204

Subscribers

People subscribed via source and target branches

to status/vote changes: