# Path: neutron_vpnaas/services/vpn/common/constants.py
# SUBNET_ENDPOINT = 'subnet'
# CIDR_ENDPOINT = 'cidr'
# VLAN_ENDPOINT = 'vlan'
# NETWORK_ENDPOINT = 'network'
# ROUTER_ENDPOINT = 'router'
# VPN_SUPPORTED_ENDPOINT_TYPES = [
#     SUBNET_ENDPOINT, CIDR_ENDPOINT, VLAN_ENDPOINT,
#     NETWORK_ENDPOINT, ROUTER_ENDPOINT,
# ]


from alembic import op
from oslo_utils import uuidutils
from sqlalchemy.sql import expression as sa_expr
from neutron.db import migration
from neutron_vpnaas.services.vpn.common import constants as v_constants
import sqlalchemy as sa
        if subnet_id is None:
            continue  # Skip new service entries
        # Define the subnet group
        group_id = uuidutils.generate_uuid()
        group = {'id': group_id,
                 'name': '',
                 'description': '',
                 'tenant_id': vpn_service.tenant_id,
                 'endpoint_type': v_constants.SUBNET_ENDPOINT}
        new_groups.append(group)
        # Define the (sole) endpoint
        endpoint = {'endpoint_group_id': group_id,
                    'endpoint': subnet_id}
        new_endpoints.append(endpoint)
        # Save info to use for connections
        service_map[vpn_service.id] = group_id

    connection_map = {}
    ipsec_conns = session.query(ipsec_site_conns).all()
    for connection in ipsec_conns:
        peer_cidrs = session.query(ipsecpeercidrs.c.cidr).filter(
            ipsecpeercidrs.c.ipsec_site_connection_id == connection.id).all()
        if not peer_cidrs:
            continue  # Skip new style connections
        # Define the CIDR group
        group_id = uuidutils.generate_uuid()
        group = {'id': group_id,
                 'name': '',
                 'description': '',
                 'tenant_id': connection.tenant_id,

# Path: neutron_vpnaas/services/vpn/common/constants.py
# SUBNET_ENDPOINT = 'subnet'
# CIDR_ENDPOINT = 'cidr'
# VLAN_ENDPOINT = 'vlan'
# NETWORK_ENDPOINT = 'network'
# ROUTER_ENDPOINT = 'router'
# VPN_SUPPORTED_ENDPOINT_TYPES = [
#     SUBNET_ENDPOINT, CIDR_ENDPOINT, VLAN_ENDPOINT,
#     NETWORK_ENDPOINT, ROUTER_ENDPOINT,
# ]


# Path: neutron_vpnaas/db/migration/alembic_migrations/versions/mitaka/contract/2cb4ee992b41_multiple_local_subnets.py
from alembic import op
from oslo_utils import uuidutils
from sqlalchemy.sql import expression as sa_expr
from neutron.db import migration
from neutron_vpnaas.services.vpn.common import constants as v_constants
import sqlalchemy as sa

        if subnet_id is None:
            continue  # Skip new service entries
        # Define the subnet group
        group_id = uuidutils.generate_uuid()
        group = {'id': group_id,
                 'name': '',
                 'description': '',
                 'tenant_id': vpn_service.tenant_id,
                 'endpoint_type': v_constants.SUBNET_ENDPOINT}
        new_groups.append(group)
        # Define the (sole) endpoint
        endpoint = {'endpoint_group_id': group_id,
                    'endpoint': subnet_id}
        new_endpoints.append(endpoint)
        # Save info to use for connections
        service_map[vpn_service.id] = group_id

    connection_map = {}
    ipsec_conns = session.query(ipsec_site_conns).all()
    for connection in ipsec_conns:
        peer_cidrs = session.query(ipsecpeercidrs.c.cidr).filter(
            ipsecpeercidrs.c.ipsec_site_connection_id == connection.id).all()
        if not peer_cidrs:
            continue  # Skip new style connections
        # Define the CIDR group
        group_id = uuidutils.generate_uuid()
        group = {'id': group_id,
                 'name': '',
                 'description': '',
                 'tenant_id': connection.tenant_id,

                 'endpoint_type': v_constants.CIDR_ENDPOINT}