Browse Source

Merge "Disable dns-integration API extension if it's not enabled in ML2" into stable/train

changes/66/787966/1
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
ad1d551b0c
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      networking_ovn/l3/l3_ovn.py

+ 17
- 1
networking_ovn/l3/l3_ovn.py View File

@ -18,9 +18,11 @@ from neutron.db import extraroute_db
from neutron.db import l3_gwmode_db
from neutron.db.models import l3 as l3_models
from neutron.quota import resource_registry
from neutron_lib.api.definitions import dns as dns_apidef
from neutron_lib.api.definitions import external_net
from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net as pnet
from neutron_lib.api import extensions as api_extensions
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
@ -57,7 +59,7 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
router and floatingip resources and manages associated
request/response.
"""
supported_extension_aliases = (
_supported_extension_aliases = (
extensions.ML2_SUPPORTED_API_EXTENSIONS_OVN_L3)
@resource_registry.tracked_resources(router=l3_models.Router,
@ -79,6 +81,20 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
self.create_floatingip_precommit, resources.FLOATING_IP,
events.PRECOMMIT_CREATE)
@staticmethod
def disable_dns_extension_by_extension_drivers(aliases):
core_plugin = directory.get_plugin()
if not api_extensions.is_extension_supported(
core_plugin, dns_apidef.ALIAS):
aliases.remove(dns_apidef.ALIAS)
@property
def supported_extension_aliases(self):
if not hasattr(self, '_aliases'):
self._aliases = self._supported_extension_aliases[:]
self.disable_dns_extension_by_extension_drivers(self._aliases)
return self._aliases
@property
def _ovn_client(self):
if self._ovn_client_inst is None:


Loading…
Cancel
Save