src/r53/r53.py
def lookup_zone(conn, zone):
  """Look up a zone ID for a zone string.

  Args: conn: boto.route53.Route53Connection
        zone: string eg. foursquare.com
  Returns: zone ID eg. ZE2DYFZDWGSL4.
  Raises: ZoneNotFoundError if zone not found."""
  all_zones = conn.get_all_hosted_zones()
  for resp in all_zones['ListHostedZonesResponse']['HostedZones']:
    if resp['Name'].rstrip('.') == zone.rstrip('.'):
      return resp['Id'].replace('/hostedzone/', '')
  raise ZoneNotFoundError('zone %s not found in response' % zone)
def lookup_zone(conn, zone):
  all_zones = conn.get_all_hosted_zones()
  for resp in all_zones['ListHostedZonesResponse']['HostedZones']:
    if resp['Name'].rstrip('.') == zone.rstrip('.'):
      return resp['Id'].replace('/hostedzone/', '')
  raise ZoneNotFoundError('zone %s not found in response' % zone)
def lookup_zone ( conn , zone ) : all_zones = conn . get_all_hosted_zones ( ) for resp in all_zones [ 'ListHostedZonesResponse' ] [ 'HostedZones' ] : if resp [ 'Name' ] . rstrip ( '.' ) == zone . rstrip ( '.' ) : return resp [ 'Id' ] . replace ( '/hostedzone/' , '' ) raise ZoneNotFoundError ( 'zone %s not found in response' % zone )
Look up a zone ID for a zone string.

  Args: conn: boto.route53.Route53Connection
        zone: string eg. foursquare.com
  Returns: zone ID eg. ZE2DYFZDWGSL4.
  Raises: ZoneNotFoundError if zone not found.
Look up a zone ID for a zone string .