diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-12-18 19:24:47 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-21 17:22:38 +0000 |
commit | 405c322c724cf9282dc558bb80dd0219f1029cca (patch) | |
tree | c5a27d6c34176b3b60122325554d9cae1f3bcaf8 /meta/classes | |
parent | 2ccdb82a359ffe9ae3f45d239d63fdf77cbb973f (diff) | |
download | poky-405c322c724cf9282dc558bb80dd0219f1029cca.tar.gz |
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.
(From OE-Core rev: 7f2637ec8d1b8840c31255572b5cb058777382e7)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/toaster.bbclass | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass index e1a93b5702..7c404b9e65 100644 --- a/meta/classes/toaster.bbclass +++ b/meta/classes/toaster.bbclass | |||
@@ -165,6 +165,9 @@ python toaster_collect_task_stats() { | |||
165 | import bb.utils | 165 | import bb.utils |
166 | import os | 166 | import os |
167 | 167 | ||
168 | if not e.data.getVar('BUILDSTATS_BASE', True): | ||
169 | return # if we don't have buildstats, we cannot collect stats | ||
170 | |||
168 | def _append_read_list(v): | 171 | def _append_read_list(v): |
169 | lock = bb.utils.lockfile(e.data.expand("${TOPDIR}/toaster.lock"), False, True) | 172 | lock = bb.utils.lockfile(e.data.expand("${TOPDIR}/toaster.lock"), False, True) |
170 | 173 | ||