def _get_zone(gcdns, zone_name, zone_id):
 if (zone_id is not None):
  try:
   return gcdns.get_zone(zone_id)
  except ZoneDoesNotExistError:
   return None
 available_zones = gcdns.iterate_zones()
 found_zone = None
 for zone in available_zones:
  if (zone.domain == zone_name):
   found_zone = zone
   break
 return found_zone

def _get_zone ( gcdns , zone_name , zone_id ) : if ( zone_id is not None ) : try : return gcdns . get_zone ( zone_id ) except ZoneDoesNotExistError : return None available_zones = gcdns . iterate_zones ( ) found_zone = None for zone in available_zones : if ( zone . domain == zone_name ) : found_zone = zone break return found_zone
gets the zone object for a given domain name .