예제 #1
0
파일: network.py 프로젝트: CMGS/eru-core
def get_network(id_or_name):
    if id_or_name.isdigit():
        n = Network.get(id_or_name)
    else:
        n = Network.get_by_name(id_or_name)
    if not n:
        abort(404, 'Network %s not found' % id_or_name)
    return n
예제 #2
0
def get_network(network_id):
    n = Network.get(network_id)
    if not n:
        raise EruAbortException(consts.HTTP_NOT_FOUND, 'Network %s not found' % network_id)
    return n