diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 54f6c4ebe8..160cb03743 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -308,6 +308,7 @@ class BuildInfoHelper(object): | |||
308 | def __init__(self, server, has_build_history = False): | 308 | def __init__(self, server, has_build_history = False): |
309 | self._configure_django() | 309 | self._configure_django() |
310 | self.internal_state = {} | 310 | self.internal_state = {} |
311 | self.internal_state['taskdata'] = {} | ||
311 | self.task_order = 0 | 312 | self.task_order = 0 |
312 | self.server = server | 313 | self.server = server |
313 | self.orm_wrapper = ORMWrapper() | 314 | self.orm_wrapper = ORMWrapper() |
@@ -444,7 +445,7 @@ class BuildInfoHelper(object): | |||
444 | self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures) | 445 | self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures) |
445 | 446 | ||
446 | def store_started_task(self, event): | 447 | def store_started_task(self, event): |
447 | identifier = event.taskfile + event.taskname | 448 | identifier = event.taskfile.split(":")[-1] + ":" + event.taskname |
448 | 449 | ||
449 | recipe_information = self._get_recipe_information_from_taskfile(event.taskfile) | 450 | recipe_information = self._get_recipe_information_from_taskfile(event.taskfile) |
450 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information) | 451 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information) |
@@ -472,7 +473,7 @@ class BuildInfoHelper(object): | |||
472 | 473 | ||
473 | task_obj = self.orm_wrapper.get_update_task_object(task_information) | 474 | task_obj = self.orm_wrapper.get_update_task_object(task_information) |
474 | 475 | ||
475 | self.internal_state[identifier] = { | 476 | self.internal_state['taskdata'][identifier] = { |
476 | 'start_time': datetime.datetime.now(), | 477 | 'start_time': datetime.datetime.now(), |
477 | 'outcome': task_information['outcome'], | 478 | 'outcome': task_information['outcome'], |
478 | } | 479 | } |
@@ -492,13 +493,15 @@ class BuildInfoHelper(object): | |||
492 | task_obj = self.orm_wrapper.get_update_task_object(task_information) | 493 | task_obj = self.orm_wrapper.get_update_task_object(task_information) |
493 | 494 | ||
494 | def update_and_store_task(self, event): | 495 | def update_and_store_task(self, event): |
495 | identifier = event.taskfile + event.taskname | 496 | identifier = event.taskfile.split(":")[-1] + ":" + event.taskname |
497 | assert identifier in self.internal_state['taskdata'] | ||
498 | |||
496 | recipe_information = self._get_recipe_information_from_taskfile(event.taskfile) | 499 | recipe_information = self._get_recipe_information_from_taskfile(event.taskfile) |
497 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information) | 500 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information) |
498 | task_information = self._get_task_information(event,recipe) | 501 | task_information = self._get_task_information(event,recipe) |
499 | 502 | ||
500 | task_information['start_time'] = self.internal_state[identifier]['start_time'] | 503 | task_information['start_time'] = self.internal_state['taskdata'][identifier]['start_time'] |
501 | task_information['outcome'] = self.internal_state[identifier]['outcome'] | 504 | task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome'] |
502 | 505 | ||
503 | if 'logfile' in vars(event): | 506 | if 'logfile' in vars(event): |
504 | task_information['logfile'] = event.logfile | 507 | task_information['logfile'] = event.logfile |
@@ -516,11 +519,11 @@ class BuildInfoHelper(object): | |||
516 | if task_information['outcome'] == Task.OUTCOME_NA: | 519 | if task_information['outcome'] == Task.OUTCOME_NA: |
517 | if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)): | 520 | if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)): |
518 | task_information['outcome'] = Task.OUTCOME_SUCCESS | 521 | task_information['outcome'] = Task.OUTCOME_SUCCESS |
519 | del self.internal_state[identifier] | 522 | del self.internal_state['taskdata'][identifier] |
520 | 523 | ||
521 | if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)): | 524 | if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)): |
522 | task_information['outcome'] = Task.OUTCOME_FAILED | 525 | task_information['outcome'] = Task.OUTCOME_FAILED |
523 | del self.internal_state[identifier] | 526 | del self.internal_state['taskdata'][identifier] |
524 | 527 | ||
525 | self.orm_wrapper.get_update_task_object(task_information) | 528 | self.orm_wrapper.get_update_task_object(task_information) |
526 | 529 | ||