Esempio n. 1
0
def process(sid, params):

    #删除所有的tag
    podtags = DBSession.query(model.podtag).filter_by(pid=params['pid']).all()
    for podtag in podtags:
        tag_delete.processNoUpdate(sid,{"pid":params['pid'],"tid":podtag.tid})

    #删除pod
    pod = DBSession.query(model.podspec).filter_by(pid=params['pid']).first()
    if not pod:
        return dict(errors={'pod':'pod not found'})
    DBSession.delete(pod)

    # 删除成功之后更新未二进制的podspec
    update_no_lib.process(sid,params)

    #podspecs = DBSession.query(model.podspec).filter_by(pid=55).all()
    return ({}, 'success.')
Esempio n. 2
0
        return dict(errors={'podtag': 'podtag not found'})

    #删除对应tag的二进制库
    pod = DBSession.query(model.podspec).filter_by(pid=params['pid']).first()
    try:
        deleteScript.deleteFramework(copy.deepcopy(pod), podtag.tag,
                                     podtag.tagBranch)
    except Exception, e:
        status, message = e.args
        if status == 4:
            raise APIError(4, message)
        else:
            raise APIError(1, traceback.format_exc())

    #删除数据库中的tag信息
    DBSession.delete(podtag)

    # 删除成功之后更新未二进制的podspec
    update_no_lib.process(sid, params)

    #podspecs = DBSession.query(model.podspec).filter_by(pid=55).all()
    return (podtag, 'success.')


def processNoUpdate(sid, params):
    podtag = DBSession.query(model.podtag).get(params['tid'])
    if not podtag:
        return dict(errors={'podtag': 'podtag not found'})

    #删除对应tag的二进制库
    pod = DBSession.query(model.podspec).filter_by(pid=params['pid']).first()