async def do_upload(context, files):
    """Upload artifacts and return status.

    Returns the integer status of the upload.

    args:
        context (scriptworker.context.Context): the scriptworker context.
        files (list of str): list of files to be uploaded as artifacts

    Raises:
        Exception: on unexpected exception.

    Returns:
        int: exit status

    """
    status = 0
    try:
        await upload_artifacts(context, files)
    except ScriptWorkerException as e:
        status = worst_level(status, e.exit_code)
        log.error("Hit ScriptWorkerException: {}".format(e))
    except aiohttp.ClientError as e:
        status = worst_level(status, STATUSES['intermittent-task'])
        log.error("Hit aiohttp error: {}".format(e))
    except Exception as e:
        log.exception("SCRIPTWORKER_UNEXPECTED_EXCEPTION upload {}".format(e))
        raise
    return status
async def do_upload ( context , files ) : status = 0 try : await upload_artifacts ( context , files ) except ScriptWorkerException as e : status = worst_level ( status , e . exit_code ) log . error ( "Hit ScriptWorkerException: {}" . format ( e ) ) except aiohttp . ClientError as e : status = worst_level ( status , STATUSES [ 'intermittent-task' ] ) log . error ( "Hit aiohttp error: {}" . format ( e ) ) except Exception as e : log . exception ( "SCRIPTWORKER_UNEXPECTED_EXCEPTION upload {}" . format ( e ) ) raise return status
Upload artifacts and return status.

    Returns the integer status of the upload.

    args:
        context (scriptworker.context.Context): the scriptworker context.
        files (list of str): list of files to be uploaded as artifacts

    Raises:
        Exception: on unexpected exception.

    Returns:
        int: exit status