Exemple #1
0
def _rerun_task(task_id, label):
    state = taskcluster.state_task(task_id)
    if state not in RERUN_STATES:
        logger.warning("No need to rerun {}: state '{}' not in {}!".format(
            label, state, RERUN_STATES))
        return
    taskcluster.rerun_task(task_id)
    logger.info("Reran {}".format(label))
Exemple #2
0
def rerun_action(parameters, graph_config, input, task_group_id, task_id,
                 task):
    parameters = dict(parameters)
    decision_task_id, full_task_graph, label_to_taskid = fetch_graph_and_labels(
        parameters, graph_config)
    label = task['metadata']['name']
    if task_id not in label_to_taskid.values():
        logger.error(
            "Refusing to rerun {}: taskId {} not in decision task {} label_to_taskid!"
            .format(label, task_id, decision_task_id))

    status = status_task(task_id)
    if status not in RERUN_STATES:
        logger.error("Refusing to rerun {}: state {} not in {}!".format(
            label, status, RERUN_STATES))
        sys.exit(1)
    rerun_task(task_id)
    logger.info('Reran {}'.format(label))