[OE-core] [PATCH] toaster.bbclass: fix TypeError when parsing build stats

Elliot Smith elliot.smith at intel.com
Tue Dec 22 16:06:56 UTC 2015


Reading IO stats fails because the IO read/write bytes are
being converted to strings, then added to a numeric running
total.

Fix this by converting IO stats to integers.

Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
 meta/classes/toaster.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index 4fb52a9..bbda2f8 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -212,10 +212,10 @@ python toaster_collect_task_stats() {
             cpu_usage = str(statinfo["CPU usage"]).strip('% \n\r')
 
         if "IO write_bytes" in statinfo:
-            disk_io = disk_io + str(statinfo["IO write_bytes"]).strip('% \n\r')
+            disk_io = disk_io + int(statinfo["IO write_bytes"].strip('% \n\r'))
 
         if "IO read_bytes" in statinfo:
-            disk_io = disk_io + str(statinfo["IO read_bytes"]).strip('% \n\r')
+            disk_io = disk_io + int(statinfo["IO read_bytes"].strip('% \n\r'))
 
         if "Started" in statinfo:
             started = str(statinfo["Started"]).strip('% \n\r')
-- 
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.




More information about the Openembedded-core mailing list