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

This commit is contained in:
Zuul 2019-06-23 10:44:37 +00:00 committed by Gerrit Code Review
commit bf3f0b67e4
3 changed files with 8 additions and 1 deletions

View File

@ -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,

View File

@ -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')

View File

@ -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):