Merge lp:~codehelp/lava-scheduler/fix1208805-update into lp:lava-scheduler/multinode

Proposed by Neil Williams
Status: Merged
Approved by: Senthil Kumaran S
Approved revision: 269
Merged at revision: 269
Proposed branch: lp:~codehelp/lava-scheduler/fix1208805-update
Merge into: lp:lava-scheduler/multinode
Diff against target: 43 lines (+12/-5)
1 file modified
lava_scheduler_daemon/dbjobsource.py (+12/-5)
To merge this branch: bzr merge lp:~codehelp/lava-scheduler/fix1208805-update
Reviewer Review Type Date Requested Status
Senthil Kumaran S Approve
Review via email: mp+179353@code.launchpad.net

Description of the change

The job list was not looking at the dispatcher_config devices list for the boards actually available on the machine running this scheduler. This patch adds a check on this list and prevents jobs being added if there is no configured board.

To post a comment you must log in.
Revision history for this message
Senthil Kumaran S (stylesen) wrote :

Looks good to me +1 to merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_scheduler_daemon/dbjobsource.py'
2--- lava_scheduler_daemon/dbjobsource.py 2013-08-01 12:50:21 +0000
3+++ lava_scheduler_daemon/dbjobsource.py 2013-08-09 08:48:25 +0000
4@@ -93,9 +93,12 @@
5 return self.deferToThread(wrapper, *args, **kw)
6
7 def getBoardList_impl(self):
8+ self.logger.info("Checking configured devices")
9 configured_boards = [
10 x.hostname for x in dispatcher_config.get_devices()]
11 boards = []
12+ for d in configured_boards:
13+ self.logger.info("%s is configured" % d.hostname)
14 for d in Device.objects.all():
15 if d.hostname in configured_boards:
16 boards.append({'hostname': d.hostname})
17@@ -179,7 +182,9 @@
18 status=TestJob.SUBMITTED).order_by('-priority', 'submit_time')
19 job_list = self._get_health_check_jobs()
20 devices = None
21-
22+ configured_boards = [
23+ x.hostname for x in dispatcher_config.get_devices()]
24+ self.logger.debug("Number of configured_devices: %d" % len(configured_boards))
25 for job in jobs:
26 if job.actual_device:
27 job_list.add(job)
28@@ -196,10 +201,12 @@
29 else:
30 continue
31 if devices:
32- device = devices[0]
33- job = self._fix_device(device, job)
34- if job:
35- job_list.add(job)
36+ for d in devices:
37+ self.logger.info("Checking %s" % d.hostname)
38+ if d.hostname in configured_boards:
39+ job = self._fix_device(d, job)
40+ if job:
41+ job_list.add(job)
42
43 return job_list
44

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: