Merge "NSXv: prevent host route creation"

This commit is contained in:
Jenkins 2015-08-19 11:17:59 +00:00 committed by Gerrit Code Review
commit e05d7c454c
2 changed files with 28 additions and 0 deletions
vmware_nsx/neutron
plugins/vmware/plugins
tests/unit/vmware

@ -1036,6 +1036,9 @@ class NsxVPluginV2(agents_db.AgentDbMixin,
the subnet is attached is not bound to an DHCP Edge, nsx_v will
create the Edge and make sure the network is bound to the Edge
"""
if subnet['subnet']['host_routes'] != attr.ATTR_NOT_SPECIFIED:
err_msg = _("Host routes not supported by plugin")
raise n_exc.InvalidInput(error_message=err_msg)
if subnet['subnet']['enable_dhcp']:
filters = {'id': [subnet['subnet']['network_id']],
'router:external': [True]}
@ -1060,6 +1063,10 @@ class NsxVPluginV2(agents_db.AgentDbMixin,
return s
def update_subnet(self, context, id, subnet):
s = subnet['subnet']
if "host_routes" in s:
err_msg = _("Host routes not supported by plugin")
raise n_exc.InvalidInput(error_message=err_msg)
orig = self._get_subnet(context, id)
gateway_ip = orig['gateway_ip']
enable_dhcp = orig['enable_dhcp']

@ -999,6 +999,27 @@ class TestSubnetsV2(NsxVPluginV2TestCase,
kwargs.update({'override': overrides})
return self._create_bulk(fmt, number, 'subnet', base_data, **kwargs)
def test_create_subnet_with_two_host_routes(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_delete_subnet_with_route(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_update_subnet_adding_additional_host_routes_and_dns(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_delete_subnet_with_dns_and_route(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_update_subnet_route(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_update_subnet_route_to_None(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_create_subnet_with_one_host_route(self):
self.skipTest("Skip test for not implemented host_routes feature")
def test_create_subnet_nonzero_cidr(self):
awkward_cidrs = [{'nonezero': '10.129.122.5/8',
'corrected': '10.0.0.0/8'},