Browse Source

Merge "[NSX-p] Check for a LB before enabling/disabling service router"

changes/34/666534/4
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
bf3f0b67e4
  1. 3
      vmware_nsx/plugins/nsx_p/plugin.py
  2. 3
      vmware_nsx/tests/unit/nsx_p/test_plugin.py
  3. 3
      vmware_nsx/tests/unit/services/vpnaas/test_nsxp_vpnaas.py

3
vmware_nsx/plugins/nsx_p/plugin.py

@ -1558,8 +1558,9 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
router_subnets = self._find_router_subnets(
context.elevated(), router_id)
sr_currently_exists = self.verify_sr_at_backend(router_id)
lb_exist = False
lb_exist = self.service_router_has_loadbalancers(context, router_id)
fw_exist = self._router_has_edge_fw_rules(context, router)
# TODO(asarfaty): Add vpnaas check here
actions = self._get_update_router_gw_actions(
org_tier0_uuid, orgaddr, org_enable_snat,
new_tier0_uuid, newaddr, new_enable_snat,

3
vmware_nsx/tests/unit/nsx_p/test_plugin.py

@ -1435,6 +1435,9 @@ class NsxPTestL3NatTestCase(NsxPTestL3NatTest,
def setUp(self, *args, **kwargs):
super(NsxPTestL3NatTestCase, self).setUp(*args, **kwargs)
mock.patch.object(self.plugin.nsxpolicy, 'search_by_tags',
return_value={'results': []}).start()
def test__notify_gateway_port_ip_changed(self):
self.skipTest('not supported')

3
vmware_nsx/tests/unit/services/vpnaas/test_nsxp_vpnaas.py

@ -540,6 +540,9 @@ class TestVpnaasDriver(test_plugin.NsxPPluginTestCaseMixin):
self.policy_vpn = self.plugin.nsxpolicy.ipsec_vpn
self.l3plugin = self.plugin
mock.patch.object(self.plugin.nsxpolicy, 'search_by_tags',
return_value={'results': []}).start()
@contextlib.contextmanager
def router(self, name='vpn-test-router', tenant_id=_uuid(),
admin_state_up=True, **kwargs):

Loading…
Cancel
Save