Exemplo n.º 1
0
 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
Exemplo n.º 2
0
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