From ab831e867f09b47001cb8da2f8f060e04febf237 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Mon, 6 Dec 2010 14:58:55 -0700 Subject: Move the runq task start/failed messages to the UI Signed-off-by: Chris Larson --- lib/bb/runqueue.py | 12 +++--------- lib/bb/ui/knotty.py | 11 +++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 635a7b145..bce4b1b2a 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -977,13 +977,8 @@ class RunQueueExecute: self.rq.state = runQueueComplete return - def notify_task_started(self, task): bb.event.fire(runQueueTaskStarted(task, self.stats, self.rq), self.cfgData) - logger.info("Running task %d of %d (ID: %s, %s)", self.stats.completed + self.stats.active + self.stats.failed + 1, - self.stats.total, - task, - self.rqdata.get_user_idstring(task)) def notify_task_completed(self, task): bb.event.fire(runQueueTaskCompleted(task, self.stats, self.rq), self.cfgData) @@ -1103,12 +1098,10 @@ class RunQueueExecuteTasks(RunQueueExecute): Called when a task has failed Updates the state engine with the failure """ - logger.error("Task %s (%s) failed with exit code '%s'", task, - self.rqdata.get_user_idstring(task), exitcode) self.stats.taskFailed() fnid = self.rqdata.runq_fnid[task] self.failed_fnids.append(fnid) - bb.event.fire(runQueueTaskFailed(task, self.stats, self.rq), self.cfgData) + bb.event.fire(runQueueTaskFailed(task, self.stats, exitcode, self.rq), self.cfgData) if self.rqdata.taskData.abort: self.rq.state = runQueueCleanUp @@ -1219,8 +1212,9 @@ class runQueueTaskFailed(runQueueEvent): """ Event notifing a task failed """ - def __init__(self, task, stats, rq): + def __init__(self, task, stats, exitcode, rq): runQueueEvent.__init__(self, task, stats, rq) + self.exitcode = exitcode self.message = "Task %s failed (%s)" % (task, self.taskstring) class runQueueTaskCompleted(runQueueEvent): diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py index 8a7b2b760..8a077df2e 100644 --- a/lib/bb/ui/knotty.py +++ b/lib/bb/ui/knotty.py @@ -189,6 +189,17 @@ def main(server, eventHandler): logger.error("Nothing %sPROVIDES '%s'", r, event._item) continue + if isinstance(event, bb.runqueue.runQueueTaskStarted): + logger.info("Running task %s of %s (ID: %s, %s)", + event.stats.completed + event.stats.active + event.stats.failed + 1, + event.stats.total, event.taskid, event.taskstring) + continue + + if isinstance(event, bb.runqueue.runQueueTaskFailed): + logger.error("Task %s (%s) failed with exit code '%s'", + event.taskid, event.taskstring, event.exitcode) + continue + # ignore if isinstance(event, (bb.event.BuildBase, bb.event.StampUpdate, -- cgit 1.2.3-korg