(zone)
return '-'.join(parts[:2])
Derives the region from a zone name.
Derives the region from a zone name.
Derives the region from a zone name .
def ZoneToRegion(zone):
  """Derives the region from a zone name."""
  parts = zone.split('-')
  if len(parts) != 3:
    raise Error('Cannot derive region from zone "%s"' % zone)
  return '-'.join(parts[:2])
def ZoneToRegion ( zone ) : parts = zone . split ( '-' ) if len ( parts ) != 3 : raise Error ( 'Cannot derive region from zone "%s"' % zone ) return '-' . join ( parts [ : 2 ] )