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

TMSS-207: adapted client code to new auto-generated json keys for <choice>_value and <related> ids

parent b6703417
No related branches found
No related tags found
1 merge request!175Resolve TMSS-207
......@@ -365,8 +365,7 @@ class PipelineControlTMSSHandler(TMSSSubTaskEventMessageHandler):
scheduled_pipeline_subtask_ids = []
for subtask in scheduled_subtasks:
try:
bits = subtask['url'].split('/')
subtask_id = int(bits[bits.index("subtask") + 1])
subtask_id = subtask['id']
scheduled_pipeline_subtask_ids.append(subtask_id)
except Exception as e:
logger.error(e)
......
......@@ -92,7 +92,7 @@ def main_set_subtask_state():
try:
with TMSSsession.create_from_dbcreds_for_ldap() as session:
changed_subtask = session.set_subtask_status(args.subtask_id, args.state)
print("%s now has state %s" % (changed_subtask['url'], changed_subtask['state']))
print("%s now has state %s, see: %s" % (changed_subtask['id'], changed_subtask['state_value'], changed_subtask['url']))
except Exception as e:
print(e)
exit(1)
......
......@@ -66,14 +66,14 @@ class TMSSSubTaskSchedulingEventMessageHandler(TMSSSubTaskEventMessageHandler):
for successor in successors:
try:
suc_subtask_id = successor['url'].split('/')[successor['url'].split('/').index('subtask')+1] #ugly -> check how I can get the ¨id¨
suc_subtask_state = successor['state_str']
suc_subtask_id = successor['id']
suc_subtask_state = successor['state_value']
if suc_subtask_state == "defined":
logger.info("trying to schedule successor subtask %s for finished subtask %s", suc_subtask_id, subtask_id)
scheduled_successor = self.tmss_client.schedule_subtask(suc_subtask_id)
suc_subtask_state = scheduled_successor['state_str']
logger.info("successor subtask %s for finished subtask %s is now has state '%s'", suc_subtask_id, subtask_id, suc_subtask_state)
suc_subtask_state = scheduled_successor['state_value']
logger.info("successor subtask %s for finished subtask %s now has state '%s', see %s", suc_subtask_id, subtask_id, suc_subtask_state, scheduled_successor['url'])
else:
logger.warning("skipping scheduling of successor subtask %s for finished subtask %s because its state is '%s'", suc_subtask_id, subtask_id, suc_subtask_state)
......
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