=== modified file 'lava_scheduler_daemon/board.py'
@@ -57,7 +57,7 @@
def processEnded(self, reason):
self.log_file.close()
- self.deferred.callback(None)
+ self.deferred.callback(reason.value.exitCode)
class Job(object):
@@ -104,15 +104,15 @@
d.addBoth(self._exited)
return d
- def _exited(self, result):
+ def _exited(self, exit_code):
self.logger.info("job finished on %s", self.job_data['target'])
if self._json_file is not None:
os.unlink(self._json_file)
self.logger.info("reporting job completed")
self._source_lock.run(self._checkCancel_call.stop)
return self._source_lock.run(
- self.source.jobCompleted, self.board_name).addCallback(
- lambda r:result)
+ self.source.jobCompleted, self.board_name, exit_code).addCallback(
+ lambda r:exit_code)
class SimplePP(ProcessProtocol):
=== modified file 'lava_scheduler_daemon/dbjobsource.py'
@@ -135,7 +135,7 @@
def getLogFileForJobOnBoard(self, board_name):
return self.deferForDB(self.getLogFileForJobOnBoard_impl, board_name)
- def jobCompleted_impl(self, board_name):
+ def jobCompleted_impl(self, board_name, exit_code):
self.logger.debug('marking job as complete on %s', board_name)
device = Device.objects.get(hostname=board_name)
if device.status == Device.RUNNING:
@@ -149,7 +149,10 @@
job = device.current_job
device.current_job = None
if job.status == TestJob.RUNNING:
- job.status = TestJob.COMPLETE
+ if exit_code == 0:
+ job.status = TestJob.COMPLETE
+ else:
+ job.status = TestJob.INCOMPLETE
elif job.status == TestJob.CANCELING:
job.status = TestJob.CANCELED
else:
@@ -160,8 +163,8 @@
device.save()
job.save()
- def jobCompleted(self, board_name):
- return self.deferForDB(self.jobCompleted_impl, board_name)
+ def jobCompleted(self, board_name, exit_code):
+ return self.deferForDB(self.jobCompleted_impl, board_name, exit_code)
def jobOobData_impl(self, board_name, key, value):
self.logger.info(