'Ensure the region for the endpoint exists.
If \'region_id\' is used to specify the region, then we will let the
manager/driver take care of this.  If, however, \'region\' is used,
then for backward compatibility, we will auto-create the region.'

def _validate_endpoint_region(self, endpoint, request):

    if ((endpoint.get('region_id') is None) and (endpoint.get('region') is not None)):
        endpoint['region_id'] = endpoint.pop('region')
        try:
            self.catalog_api.get_region(endpoint['region_id'])
        except exception.RegionNotFound:
            region = dict(id=endpoint['region_id'])
            self.catalog_api.create_region(region, initiator=request.audit_initiator)
    return endpoint
