

def _delete_subnet_vpn(context, neutron, cleaner, subnet, vpn_connection):
    subnets_connections = vpn_connection['os_ipsec_site_connections']
    os_connection_id = subnets_connections.get(subnet['id'])
    if (not os_connection_id):
        return
    _remove_subnet_connection_from_vpn_connection_item(context, vpn_connection, subnet['id'])
    cleaner.addCleanup(_add_subnet_connection_to_vpn_connection_item, context, vpn_connection, subnet['id'], os_connection_id)
    try:
        neutron.delete_ipsec_site_connection(os_connection_id)
    except neutron_exception.NotFound:
        pass

dataset/ETHPy150Open openstack/ec2-api/ec2api/api/vpn_connection.py _delete_subnet_vpn/original