[oe-commits] Alexandru DAMIAN : toaster.bbclass: fix crash on buildstats collection

git at git.openembedded.org git at git.openembedded.org
Fri Dec 20 17:16:15 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 1bab0c44c7f1d3fcf513f2056b2eb42277d43ae9
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=1bab0c44c7f1d3fcf513f2056b2eb42277d43ae9

Author: Alexandru DAMIAN <alexandru.damian at intel.com>
Date:   Wed Dec 18 19:24:47 2013 +0000

toaster.bbclass: fix crash on buildstats collection

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 at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/toaster.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index e1a93b5..7c404b9 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -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)
 



More information about the Openembedded-commits mailing list