예제 #1
0
def delete_gerrit(gerrit_id):
    """
    Deletes a gerrit instance

    :param gerrit_id: The ID of the gerrit instance.
    """
    gerrit = Gerrit()
    try:
        gerrit.load(str(gerrit_id))
    except DoesNotExist as err:
        return {'errors': {'gerrit_id': str(err)}}
    gerrit.delete()
    return {'success': True}
예제 #2
0
파일: gerrit.py 프로젝트: xNUTs/easycla
def delete_gerrit(gerrit_id):
    """
    Deletes a gerrit instance

    :param gerrit_id: The ID of the gerrit instance.
    """
    gerrit = Gerrit()
    try:
        gerrit.load(str(gerrit_id))
    except DoesNotExist as err:
        cla.log.warning(
            'a gerrit instance does not exist with the '
            'given Gerrit ID: {} - unable to delete'.format(gerrit_id))
        return {'errors': {'gerrit_id': str(err)}}
    gerrit.delete()
    cla.log.debug(
        'deleted gerrit instance with gerrit_id: {}'.format(gerrit_id))
    return {'success': True}