Skip to contentSkip to conversation

toaster: fix if USER_CLASSES is missing buildstats

PATCH In review Olaf Mandel 1 participant 2 messages Oct 27, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: fix if USER_CLASSES is missing buildstats

buildstats not being in USER_CLASSES is no reason to fail every single task in toaster_collect_task_stats: using a non-existing variable results in a None argument to os.path.join().

Check the variable availability before trying to use it.

---
 meta/classes/toaster.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/toaster.bbclass +2 -2
index 4bddf34..638bb39 100644
@@ -157,11 +157,11 @@ python toaster_collect_task_stats() {
     import bb.utils
     import os
 
-    toaster_statlist_file = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist")
-
     if not e.data.getVar('BUILDSTATS_BASE', True):
         return  # if we don't have buildstats, we cannot collect stats
 
+    toaster_statlist_file = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist")
+
     def stat_to_float(value):
         return float(value.strip('% \n\r'))
 
Signature · 1 line
2.1.4
#1 lore raw

Sorry about the original email: I accidentally sent it to the wrong mailing list... Please ignore it here.