]> code.ossystems Code Review - openembedded-core.git/commitdiff
toaster.bbclass: fix crash on buildstats collection
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Wed, 18 Dec 2013 19:24:47 +0000 (19:24 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 21 Dec 2013 09:05:01 +0000 (09:05 +0000)
Toaster needs buildstats to be enabled in order to
collect task statistics. The toaster.bbclass didn't
have a guard to stop task data collection if the buildstats
weren't enabled, leading to a crash.

This patch verifies that the task variables are defined before
trying to use them.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toaster.bbclass

index e1a93b57022c59c41f3f48a7f7043d65f8a84d91..7c404b9e65aa4669b09e1080b0562ddd0b849790 100644 (file)
@@ -165,6 +165,9 @@ python toaster_collect_task_stats() {
     import bb.utils
     import os
 
+    if not e.data.getVar('BUILDSTATS_BASE', True):
+        return  # if we don't have buildstats, we cannot collect stats
+
     def _append_read_list(v):
         lock = bb.utils.lockfile(e.data.expand("${TOPDIR}/toaster.lock"), False, True)