aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-04-06 17:46:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:10:28 +0100
commit4adddfde44785cc5c528ce85f0556891a5214557 (patch)
tree5335d72991febdb95fee61cdc6762c20a6dfc4c5 /bitbake
parentb1a919a92a95c7c649cde7a57480378c11988ef7 (diff)
downloadopenembedded-core-contrib-4adddfde44785cc5c528ce85f0556891a5214557.tar.gz
bitbake: toaster: fix jethro build
The keys 'started', 'ended', 'cpu_time_user', 'disk_io_read' and 'disk_io_write' were added to the event recently, so they don't exist in the events generated by bitbake server from older releases. Checking if task_to_update structure has these keys before using them should fix build of older releases. (Bitbake rev: 79611d0ea742263074fbb0bf5f1e39df75fd9f55) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 14be221726..eb0e425e2c 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -241,14 +241,16 @@ class ORMWrapper(object):
recipe__name = recipe_name
)
- task_to_update.started = self._timestamp_to_datetime(task_stats['started'])
- task_to_update.ended = self._timestamp_to_datetime(task_stats['ended'])
- task_to_update.elapsed_time = (task_stats['ended'] - task_stats['started'])
- task_to_update.cpu_time_user = task_stats['cpu_time_user']
- task_to_update.cpu_time_system = task_stats['cpu_time_system']
- task_to_update.disk_io_read = task_stats['disk_io_read']
- task_to_update.disk_io_write = task_stats['disk_io_write']
- task_to_update.disk_io = task_stats['disk_io_read'] + task_stats['disk_io_write']
+ if 'started' in task_stats and 'ended' in task_stats:
+ task_to_update.started = self._timestamp_to_datetime(task_stats['started'])
+ task_to_update.ended = self._timestamp_to_datetime(task_stats['ended'])
+ task_to_update.elapsed_time = (task_stats['ended'] - task_stats['started'])
+ task_to_update.cpu_time_user = task_stats.get('cpu_time_user')
+ task_to_update.cpu_time_system = task_stats.get('cpu_time_system')
+ if 'disk_io_read' in task_stats and 'disk_io_write' in task_stats:
+ task_to_update.disk_io_read = task_stats['disk_io_read']
+ task_to_update.disk_io_write = task_stats['disk_io_write']
+ task_to_update.disk_io = task_stats['disk_io_read'] + task_stats['disk_io_write']
task_to_update.save()