diff --git a/SAS/TMSS/backend/src/migrate_momdb_to_tmss.py b/SAS/TMSS/backend/src/migrate_momdb_to_tmss.py index 4d38aff956611eb3b0f0d5044fbffa32994c9742..a77af99efa8693c76fcaee0f43537d65bdea0848 100755 --- a/SAS/TMSS/backend/src/migrate_momdb_to_tmss.py +++ b/SAS/TMSS/backend/src/migrate_momdb_to_tmss.py @@ -506,7 +506,7 @@ def create_subtask_trees_for_project_in_momdb(project_mom2id, project): details = {"id": mom_details['mom2id'], "state": state, "specifications_doc": {}, # todo: where from? We have user_specification_id (for task?) and system_specification_id (for subtask?) on lofar_observation (I guess referring to lofar_observation_specification). Shall we piece things together from that, or is there a text blob to use? Also: pipeline info lives in obs_spec too? - "task_blueprint": task_blueprint, + #"task_blueprint": task_blueprint, # ManyToMany, use set() "specifications_template": specifications_template, "tags": ["migrated_from_MoM", "migration_incomplete"], # todo: set complete once it is verified that all info is present "priority": project.priority_rank, # todo: correct to derive from project? @@ -523,11 +523,13 @@ def create_subtask_trees_for_project_in_momdb(project_mom2id, project): if subtask_qs.count(): # todo: this will update the subtask, but other TMSS objects do not share id with MoM and get recreated with every migration run. Can we clean this up somehow? subtask_qs.update(**details) + subtask_qs.task_blueprints.set([task_blueprint]) subtask = subtask_qs.first() logger.info("...updated existing subtask tmss id=%s" % subtask.id) stats['subtasks_updated'] += 1 else: subtask = models.Subtask.objects.create(**details) + subtask.task_blueprints.set([task_blueprint]) logger.info("...created new subtask tmss id=%s" % subtask.id) stats['subtasks_created'] += 1