def topology_parents(id_): topl = topology.get(id_) UserError.check(topl is not None, UserError.ENTITY_DOES_NOT_EXIST, message="entity doesn't exist.", data={ "class_name": hierarchy.ClassName.TOPOLOGY, "id_": id_ }) return [(hierarchy.ClassName.USER, perm.user) for perm in topl.permissions]
def modifyTaskRun(top_id, mods): for mod in mods: top = topology.get(top_id) mod.run(top)
def topology_exists(id_): try: return (topology.get(id_) is not None) except: return False
def topology_parents(id_): topl = topology.get(id_) UserError.check(topl is not None, UserError.ENTITY_DOES_NOT_EXIST, message="entity doesn't exist.", data={"class_name": hierarchy.ClassName.TOPOLOGY, "id_": id_}) return [(hierarchy.ClassName.USER, perm.user) for perm in topl.permissions]