]> code.ossystems Code Review - openembedded-core.git/commitdiff
toaster.bbclass: fix TypeError when parsing build stats
authorElliot Smith <elliot.smith@intel.com>
Tue, 22 Dec 2015 16:06:56 +0000 (16:06 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Dec 2015 16:15:31 +0000 (16:15 +0000)
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@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toaster.bbclass

index 4fb52a969ec44fe59f4a2fa5ad8f08011aedce08..bbda2f8433bb6796de6d8eb8ecbf4b63da0a352b 100644 (file)
@@ -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')