def __init__(self): self.drivers = {} self._add_driver_for_vpnservice(vpn_consts.IPSEC, ipsec_driver.IPsecVPNDriver(self)) self._add_driver_for_vpnservice(vpn_consts.SSL, sslvpn_driver.SSLVPNDriver(self)) super(VPNDriverPlugin, self).__init__()
def __init__(self): """Do the initialization for the vpn service plugin here.""" self.pptp_driver = pptp.PPTPVPNDriver(self) self.ipsec_driver = ipsec.IPsecVPNDriver(self) self.openvpn_driver = openvpn.OpenVPNDriver(self) self.vpnuser_notifier = self self.get_vpn_services_funs = {} self.get_vpn_services_funs[vpn_connstants.PPTP] = ( self._get_vpn_services_by_routers) self.get_vpn_services_funs[vpn_connstants.IPSEC] = ( vpn_db.VPNPluginRpcDbMixin._get_agent_hosting_vpn_services) self.get_vpn_services_funs[vpn_connstants.OPENVPN] = ( openvpn_db.OpenVPNPluginRpcDbMixin()._get_vpn_services_by_routers) self.update_status_by_agent_funs = {} self.update_status_by_agent_funs[vpn_connstants.PPTP] = ( self._update_status_by_agent) self.update_status_by_agent_funs[vpn_connstants.IPSEC] = ( self.update_ipsec_status_by_agent) self.update_status_by_agent_funs[vpn_connstants.OPENVPN] = ( openvpn_db.OpenVPNPluginRpcDbMixin()._update_status_by_agent) self.check_for_dup_router_subnet_funs = {} self.check_for_dup_router_subnet_funs[vpn_connstants.PPTP] = ( pptp_vpn_db.PPTPDVPNDbMixin().check_for_dup_router_subnet) self.check_for_dup_router_subnet_funs[vpn_connstants.OPENVPN] = ( openvpn_db.OpenVPNDbMixin().check_for_dup_router_subnet) self.check_router_in_use_funcs = {} self.check_router_in_use_funcs[vpn_connstants.PPTP] = ( pptp_vpn_db.PPTPDVPNDbMixin().check_router_in_use) self.check_router_in_use_funcs[vpn_connstants.OPENVPN] = ( openvpn_db.OpenVPNDbMixin().check_router_in_use)
def setUp(self): super(TestIPsecDriver, self).setUp() self.addCleanup(mock.patch.stopall) mock.patch('neutron.openstack.common.rpc.create_connection').start() l3_agent = mock.Mock() l3_agent.host = FAKE_HOST plugin = mock.Mock() plugin.get_l3_agents_hosting_routers.return_value = [l3_agent] plugin_p = mock.patch('neutron.manager.NeutronManager.get_plugin') get_plugin = plugin_p.start() get_plugin.return_value = plugin service_plugin = mock.Mock() service_plugin._get_vpnservice.return_value = { 'router_id': _uuid() } self.driver = ipsec_driver.IPsecVPNDriver(service_plugin)
def __init__(self): super(VPNDriverPlugin, self).__init__() self.ipsec_driver = ipsec_driver.IPsecVPNDriver(self)