summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorJose Perez Carranza <jose.perez.carranza@intel.com>2016-08-10 10:36:17 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:35:16 +0100
commita6c9e515f8bc590612e3082ab1c4c254711c8e3b (patch)
treed765e27b201817974c4c2d4bd39ecef0f4e7617b /meta
parentbb1cbb8d5bd7639554edcddf1d2eac4abdbb48c7 (diff)
downloadopenembedded-core-a6c9e515f8bc590612e3082ab1c4c254711c8e3b.tar.gz
openembedded-core-a6c9e515f8bc590612e3082ab1c4c254711c8e3b.tar.bz2
openembedded-core-a6c9e515f8bc590612e3082ab1c4c254711c8e3b.zip
buildperf: Add support for times without decimal part
Add logic for the cases when the time retrieved does not have decimal part. Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/buildperf/base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 527563bb0b..1eb21f6813 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -244,7 +244,11 @@ class BuildPerfTest(object):
split = strtime.split(':')
hours = int(split[0]) if len(split) > 2 else 0
mins = int(split[-2])
- secs, frac = split[-1].split('.')
+ try:
+ secs, frac = split[-1].split('.')
+ except:
+ secs = split[-1]
+ frac = '0'
secs = int(secs)
microsecs = int(float('0.' + frac) * pow(10, 6))
return timedelta(0, hours*3600 + mins*60 + secs, microsecs)