Пример #1
0
def do_acc(pid, job):
    parsed = parse_pid(pid)
    lid = parsed[LID]
    ts_label = parsed[TS_LABEL]
    roots = get_data_roots(session, ts_label) # get raw data roots
    fileset = parsed_pid2fileset(parsed, roots)
    fileset[LID] = lid
    session.expire_all() # don't be stale!
    acc = Accession(session,ts_label)#,fast=True)
    # FIXME fast=True disables checksumming
    client.update(pid,ttl=3600) # allow 1hr for accession
    ret = acc.add_fileset(fileset)
    if ret=='ADDED':
        schedule_products(pid, client)
        session.commit()
        client.wakeup()
    elif ret=='FAILED':
        raise Exception('accession failed')
Пример #2
0
def get_data_roots(ts_label, product_type='raw'):
    return files.get_data_roots(session, ts_label, product_type)