Пример #1
0
def upsert_eval(dbsession, userId, record):
    rc = db_policyeval.tsadd(record['policyId'], userId, record['imageDigest'], record['tag'],
                             record['final_action'],
                             {'policyeval': record['policyeval'], 'evalId': record['evalId']},
                             session=dbsession)
    if not rc:
        raise Exception("DB update failed")
    else:
        return record
Пример #2
0
def upsert_eval(dbsession, userId, record):
    rc = db_policyeval.tsadd(
        record["policyId"],
        userId,
        record["imageDigest"],
        record["tag"],
        record["final_action"],
        {
            "policyeval": record["policyeval"],
            "evalId": record["evalId"]
        },
        session=dbsession,
    )
    if not rc:
        raise Exception("DB update failed")
    else:
        return record