Disable dns-integration API extension if it's not enabled in ML2
In case when dns-integration ML2 extension driver isn't enabled,
ovn_l 3 service plugin will now not load "dns-integration"
API extension to list it as supported.
This patch also adds method supported_extension_aliases() which was
originally introduced in patch [1] but it can't be backported.
Conflicts:
neutron/services/ovn_l3/plugin.py
[1] https://review.opendev.org/c/openstack/neutron/+/722415
Closes-bug: #1906311
Change-Id: I6a7ff14057d80196feb5fd9d47a6a73b29bc768d
(cherry picked from commit e70e3ab455
)
This commit is contained in:
parent
ec03b35eba
commit
37a65b1d27
|
@ -12,9 +12,11 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from neutron_lib.api.definitions import dns as dns_apidef
|
||||||
from neutron_lib.api.definitions import external_net
|
from neutron_lib.api.definitions import external_net
|
||||||
from neutron_lib.api.definitions import portbindings
|
from neutron_lib.api.definitions import portbindings
|
||||||
from neutron_lib.api.definitions import provider_net as pnet
|
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 events
|
||||||
from neutron_lib.callbacks import registry
|
from neutron_lib.callbacks import registry
|
||||||
from neutron_lib.callbacks import resources
|
from neutron_lib.callbacks import resources
|
||||||
|
@ -63,7 +65,7 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
|
||||||
|
|
||||||
# TODO(mjozefcz): Start consuming it from neutron-lib
|
# TODO(mjozefcz): Start consuming it from neutron-lib
|
||||||
# once available.
|
# once available.
|
||||||
supported_extension_aliases = (
|
_supported_extension_aliases = (
|
||||||
extensions.ML2_SUPPORTED_API_EXTENSIONS_OVN_L3)
|
extensions.ML2_SUPPORTED_API_EXTENSIONS_OVN_L3)
|
||||||
|
|
||||||
@resource_registry.tracked_resources(router=l3_models.Router,
|
@resource_registry.tracked_resources(router=l3_models.Router,
|
||||||
|
@ -85,6 +87,20 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
|
||||||
self.create_floatingip_precommit, resources.FLOATING_IP,
|
self.create_floatingip_precommit, resources.FLOATING_IP,
|
||||||
events.PRECOMMIT_CREATE)
|
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
|
@property
|
||||||
def _ovn_client(self):
|
def _ovn_client(self):
|
||||||
if self._ovn_client_inst is None:
|
if self._ovn_client_inst is None:
|
||||||
|
|
Loading…
Reference in New Issue