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
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