Esempio n. 1
0
def task_load_row(row):
    row['data'] = json.safe_loads(row.data or '', {})

    row['steps'] = json.safe_loads(row.steps or '', [])
    for step in row.steps:
        if 'start' in step:
            step['start'] = parser.parse(step['start'])
        if 'stop' in step:
            step['stop'] = parser.parse(step['stop'])

    if 'state' in row and row.state in TaskState:
        row['state'] = TaskState[row.state]

    return row
Esempio n. 2
0
def job_load_row(row):
    row['spec'] = json.safe_loads(row.spec or '', {})

    if 'state' in row and row.state in JobState:
        row['state'] = JobState[row.state]

    return row