diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 9b225881d8..002aecd0f3 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -116,7 +116,7 @@ from vmware_nsx.services.lbaas.nsx_v3 import lb_driver_v2 from vmware_nsx.services.qos.common import utils as qos_com_utils from vmware_nsx.services.qos.nsx_v3 import driver as qos_driver from vmware_nsx.services.trunk.nsx_v3 import driver as trunk_driver -from vmware_nsx.services.vpnaas.nsxv3 import ipsec_driver +from vmware_nsx.services.vpnaas.nsxv3 import ipsec_utils from vmware_nsxlib.v3 import core_resources as nsx_resources from vmware_nsxlib.v3 import exceptions as nsx_lib_exc from vmware_nsxlib.v3 import nsx_constants as nsxlib_consts @@ -2384,7 +2384,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, raise n_exc.InvalidInput(error_message=err_msg) def _assert_on_vpn_port_change(self, port_data): - if port_data['device_owner'] == ipsec_driver.VPN_PORT_OWNER: + if port_data['device_owner'] == ipsec_utils.VPN_PORT_OWNER: msg = _('Can not update/delete VPNaaS port %s') % port_data['id'] raise n_exc.InvalidInput(error_message=msg) diff --git a/vmware_nsx/services/vpnaas/nsxv3/ipsec_driver.py b/vmware_nsx/services/vpnaas/nsxv3/ipsec_driver.py index 306c87f5bb..f2a7a67fce 100644 --- a/vmware_nsx/services/vpnaas/nsxv3/ipsec_driver.py +++ b/vmware_nsx/services/vpnaas/nsxv3/ipsec_driver.py @@ -38,7 +38,6 @@ from vmware_nsxlib.v3 import vpn_ipsec LOG = logging.getLogger(__name__) IPSEC = 'ipsec' -VPN_PORT_OWNER = 'vpnservice' class RouterWithSNAT(nexception.BadRequest): @@ -379,7 +378,7 @@ class NSXv3IPsecVpnDriver(service_drivers.VpnDriver): def _find_vpn_service_port(self, context, router_id): """Look for the neutron port created for the vpnservice of a router""" filters = {'device_id': ['router-' + router_id], - 'device_owner': [VPN_PORT_OWNER]} + 'device_owner': [ipsec_utils.VPN_PORT_OWNER]} ports = self.l3_plugin.get_ports(context, filters=filters) if ports: return ports[0] @@ -731,7 +730,7 @@ class NSXv3IPsecVpnDriver(service_drivers.VpnDriver): 'name': 'VPN local address port', 'admin_state_up': True, 'device_id': 'router-' + vpnservice.router['id'], - 'device_owner': VPN_PORT_OWNER, + 'device_owner': ipsec_utils.VPN_PORT_OWNER, 'fixed_ips': constants.ATTR_NOT_SPECIFIED, 'mac_address': constants.ATTR_NOT_SPECIFIED, 'port_security_enabled': False, diff --git a/vmware_nsx/services/vpnaas/nsxv3/ipsec_utils.py b/vmware_nsx/services/vpnaas/nsxv3/ipsec_utils.py index 4ed12b42ee..2554c75ef6 100644 --- a/vmware_nsx/services/vpnaas/nsxv3/ipsec_utils.py +++ b/vmware_nsx/services/vpnaas/nsxv3/ipsec_utils.py @@ -15,6 +15,8 @@ from vmware_nsxlib.v3 import vpn_ipsec +VPN_PORT_OWNER = 'vpnservice' + ENCRYPTION_ALGORITHM_MAP = { 'aes-128': vpn_ipsec.EncryptionAlgorithmTypes.ENCRYPTION_ALGORITHM_128, 'aes-256': vpn_ipsec.EncryptionAlgorithmTypes.ENCRYPTION_ALGORITHM_256,