예제 #1
0
파일: __init__.py 프로젝트: INCF/ids-tools
 def get(self):
     zone_list = get_zone_details()
     if zone_list is None:
         abort(500, message="Server failed to retrieve zone information")
     zones = []
     for zone in zone_list:
         zones.append(marshal(zone, zone_fields))
     return zones
예제 #2
0
파일: __init__.py 프로젝트: INCF/ids-tools
def lookup_zone(zone_name, abort_notfound=True):
    """
    Get the requested zone resource, or abort with
    an appropriate error code.
    """
    zone = get_zone_details(zone_name=zone_name)
    if zone is None:
        abort(500, message="Server failed to retrieve zone information from iRODS")
    if zone:
        return zone[0]
    if abort_notfound:
        abort(404, message="Zone %s does not exist" % zone_name)
    return None