Browse Source

Octavia: Improve callbacks for non TVD cases

_check_lb_service_on_router should not call plugin get_router
if hte core plugin is not TVD.
The new code improves the general case of regular plugins.

Change-Id: I4a63d5855c2a72e3b8d687d21f08e3718cd91981
tags/16.0.0
asarfaty 3 months ago
parent
commit
f9c4e6b2a3
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      vmware_nsx/services/lbaas/octavia/octavia_listener.py

+ 11
- 6
vmware_nsx/services/lbaas/octavia/octavia_listener.py View File

@@ -140,12 +140,17 @@ class NSXOctaviaListenerEndpoint(object):
payload=None):
"""Prevent removing a router GW or deleting a router used by LB"""
router_id = payload.resource_id
# get the default core plugin so we can get the router project
default_core_plugin = self._get_default_core_plugin(payload.context)
router = default_core_plugin.get_router(payload.context, router_id)
# get the real core plugin
core_plugin = self._get_core_plugin(
payload.context, router['project_id'])
core_plugin = self.loadbalancer.core_plugin
if core_plugin.is_tvd_plugin():
# TVD support
# get the default core plugin so we can get the router project
default_core_plugin = self._get_default_core_plugin(
payload.context)
router = default_core_plugin.get_router(
payload.context, router_id)
# get the real core plugin
core_plugin = self._get_core_plugin(
payload.context, router['project_id'])
if core_plugin.service_router_has_loadbalancers(
payload.context, router_id):
msg = _('Cannot delete a %s as it still has lb service '


Loading…
Cancel
Save