Skip to content
Snippets Groups Projects
Commit 74f0f721 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #9607: logging in processPredecessors

parent 76a0b317
No related branches found
No related tags found
No related merge requests found
...@@ -215,14 +215,27 @@ class ResourceAssigner(): ...@@ -215,14 +215,27 @@ class ResourceAssigner():
if predecessor_trees: if predecessor_trees:
otdb_id = specification_tree['otdb_id'] otdb_id = specification_tree['otdb_id']
pred_otdb_ids = [pt['otdb_id'] for pt in predecessor_trees]
logger.info('proccessing predecessors otdb_ids=%s for otdb_id=%s', pred_otdb_ids, otdb_id)
task = self.radbrpc.getTask(otdb_id=otdb_id) task = self.radbrpc.getTask(otdb_id=otdb_id)
for predecessor_tree in predecessor_trees: if task:
pred_otdb_id = predecessor_tree['otdb_id'] for predecessor_tree in predecessor_trees:
predecessor_task = self.radbrpc.getTask(otdb_id=pred_otdb_id) #first process the predecessor's predecessors
if predecessor_task and predecessor_task['id'] not in task['predecessor_ids']: self.processPredecessors(predecessor_tree)
self.radbrpc.insertTaskPredecessor(task['id'], predecessor_task['id'])
self.processPredecessors(predecessor_tree) #then check if the predecessor needs to be linked to this task
pred_otdb_id = predecessor_tree['otdb_id']
predecessor_task = self.radbrpc.getTask(otdb_id=pred_otdb_id)
if predecessor_task:
if predecessor_task['id'] not in task['predecessor_ids']:
logger.info('connecting predecessor task with otdb_id=%s to it\'s successor with otdb_id=%s', pred_otdb_id, otdb_id)
self.radbrpc.insertTaskPredecessor(task['id'], predecessor_task['id'])
else:
logger.warning('could not find predecessor task with otdb_id=%s in radb for task otdb_id=%s', pred_otdb_id, otdb_id)
else:
logger.info('no predecessors for otdb_id=%s', specification_tree['otdb_id'])
except Exception as e: except Exception as e:
logger.error(e) logger.error(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment