def generate_cot_body(context):
    """Generate the chain of trust dictionary.

    This is the unsigned and unformatted chain of trust artifact contents.

    Args:
        context (scriptworker.context.Context): the scriptworker context.

    Returns:
        dict: the unsignd and unformatted chain of trust artifact contents.

    Raises:
        ScriptWorkerException: on error.

    """
    try:
        cot = {
            'artifacts': get_cot_artifacts(context),
            'chainOfTrustVersion': 1,
            'runId': context.claim_task['runId'],
            'task': context.task,
            'taskId': context.claim_task['status']['taskId'],
            'workerGroup': context.claim_task['workerGroup'],
            'workerId': context.config['worker_id'],
            'workerType': context.config['worker_type'],
            'environment': get_cot_environment(context),
        }
    except (KeyError, ) as exc:
        raise ScriptWorkerException("Can't generate chain of trust! {}".format(str(exc)))

    return cot
def generate_cot_body ( context ) : try : cot = { 'artifacts' : get_cot_artifacts ( context ) , 'chainOfTrustVersion' : 1 , 'runId' : context . claim_task [ 'runId' ] , 'task' : context . task , 'taskId' : context . claim_task [ 'status' ] [ 'taskId' ] , 'workerGroup' : context . claim_task [ 'workerGroup' ] , 'workerId' : context . config [ 'worker_id' ] , 'workerType' : context . config [ 'worker_type' ] , 'environment' : get_cot_environment ( context ) , } except ( KeyError , ) as exc : raise ScriptWorkerException ( "Can't generate chain of trust! {}" . format ( str ( exc ) ) ) return cot
Generate the chain of trust dictionary.

    This is the unsigned and unformatted chain of trust artifact contents.

    Args:
        context (scriptworker.context.Context): the scriptworker context.

    Returns:
        dict: the unsignd and unformatted chain of trust artifact contents.

    Raises:
        ScriptWorkerException: on error.