Merge "Don't load DNS integration in l3_router_plugin"
This commit is contained in:
@@ -28,8 +28,6 @@ from neutron.db import model_base
|
|||||||
from neutron.db import models_v2
|
from neutron.db import models_v2
|
||||||
from neutron.extensions import dns
|
from neutron.extensions import dns
|
||||||
from neutron.extensions import l3
|
from neutron.extensions import l3
|
||||||
from neutron import manager
|
|
||||||
from neutron.plugins.common import constants as service_constants
|
|
||||||
from neutron.services.externaldns import driver
|
from neutron.services.externaldns import driver
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@@ -193,9 +191,8 @@ class DNSDbMixin(object):
|
|||||||
def _process_dns_floatingip_update_precommit(self, context,
|
def _process_dns_floatingip_update_precommit(self, context,
|
||||||
floatingip_data):
|
floatingip_data):
|
||||||
# expects to be called within a plugin's session
|
# expects to be called within a plugin's session
|
||||||
plugin = manager.NeutronManager.get_service_plugins().get(
|
if not utils.is_extension_supported(self._core_plugin,
|
||||||
service_constants.L3_ROUTER_NAT)
|
dns.Dns.get_alias()):
|
||||||
if not utils.is_extension_supported(plugin, dns.Dns.get_alias()):
|
|
||||||
return
|
return
|
||||||
if not self.dns_driver:
|
if not self.dns_driver:
|
||||||
return
|
return
|
||||||
@@ -251,9 +248,8 @@ class DNSDbMixin(object):
|
|||||||
[floatingip_data['floating_ip_address']])
|
[floatingip_data['floating_ip_address']])
|
||||||
|
|
||||||
def _process_dns_floatingip_delete(self, context, floatingip_data):
|
def _process_dns_floatingip_delete(self, context, floatingip_data):
|
||||||
plugin = manager.NeutronManager.get_service_plugins().get(
|
if not utils.is_extension_supported(self._core_plugin,
|
||||||
service_constants.L3_ROUTER_NAT)
|
dns.Dns.get_alias()):
|
||||||
if not utils.is_extension_supported(plugin, dns.Dns.get_alias()):
|
|
||||||
return
|
return
|
||||||
dns_data_db = context.session.query(FloatingIPDNS).filter_by(
|
dns_data_db = context.session.query(FloatingIPDNS).filter_by(
|
||||||
floatingip_id=floatingip_data['id']).one_or_none()
|
floatingip_id=floatingip_data['id']).one_or_none()
|
||||||
|
|||||||
@@ -1104,7 +1104,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
|
|||||||
msg = _("Network %s does not contain any IPv4 subnet") % f_net_id
|
msg = _("Network %s does not contain any IPv4 subnet") % f_net_id
|
||||||
raise n_exc.BadRequest(resource='floatingip', msg=msg)
|
raise n_exc.BadRequest(resource='floatingip', msg=msg)
|
||||||
|
|
||||||
dns_integration = utils.is_extension_supported(self, 'dns-integration')
|
dns_integration = utils.is_extension_supported(self._core_plugin,
|
||||||
|
'dns-integration')
|
||||||
with context.session.begin(subtransactions=True):
|
with context.session.begin(subtransactions=True):
|
||||||
# This external port is never exposed to the tenant.
|
# This external port is never exposed to the tenant.
|
||||||
# it is used purely for internal system and admin use when
|
# it is used purely for internal system and admin use when
|
||||||
@@ -1171,7 +1172,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
|
|||||||
|
|
||||||
def _update_floatingip(self, context, id, floatingip):
|
def _update_floatingip(self, context, id, floatingip):
|
||||||
fip = floatingip['floatingip']
|
fip = floatingip['floatingip']
|
||||||
dns_integration = utils.is_extension_supported(self, 'dns-integration')
|
dns_integration = utils.is_extension_supported(self._core_plugin,
|
||||||
|
'dns-integration')
|
||||||
with context.session.begin(subtransactions=True):
|
with context.session.begin(subtransactions=True):
|
||||||
floatingip_db = self._get_floatingip(context, id)
|
floatingip_db = self._get_floatingip(context, id)
|
||||||
old_floatingip = self._make_floatingip_dict(floatingip_db)
|
old_floatingip = self._make_floatingip_dict(floatingip_db)
|
||||||
@@ -1210,7 +1212,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
|
|||||||
def _delete_floatingip(self, context, id):
|
def _delete_floatingip(self, context, id):
|
||||||
floatingip = self._get_floatingip(context, id)
|
floatingip = self._get_floatingip(context, id)
|
||||||
floatingip_dict = self._make_floatingip_dict(floatingip)
|
floatingip_dict = self._make_floatingip_dict(floatingip)
|
||||||
if utils.is_extension_supported(self, 'dns-integration'):
|
if utils.is_extension_supported(self._core_plugin, 'dns-integration'):
|
||||||
self._process_dns_floatingip_delete(context, floatingip_dict)
|
self._process_dns_floatingip_delete(context, floatingip_dict)
|
||||||
# Foreign key cascade will take care of the removal of the
|
# Foreign key cascade will take care of the removal of the
|
||||||
# floating IP record once the port is deleted. We can't start
|
# floating IP record once the port is deleted. We can't start
|
||||||
|
|||||||
@@ -54,8 +54,7 @@ class L3RouterPlugin(service_base.ServicePluginBase,
|
|||||||
"""
|
"""
|
||||||
supported_extension_aliases = ["dvr", "router", "ext-gw-mode",
|
supported_extension_aliases = ["dvr", "router", "ext-gw-mode",
|
||||||
"extraroute", "l3_agent_scheduler",
|
"extraroute", "l3_agent_scheduler",
|
||||||
"l3-ha", "router_availability_zone",
|
"l3-ha", "router_availability_zone"]
|
||||||
"dns-integration"]
|
|
||||||
|
|
||||||
@resource_registry.tracked_resources(router=l3_db.Router,
|
@resource_registry.tracked_resources(router=l3_db.Router,
|
||||||
floatingip=l3_db.FloatingIP)
|
floatingip=l3_db.FloatingIP)
|
||||||
|
|||||||
Reference in New Issue
Block a user