Merge "Revert "Fix validation of physical network name for flat nets""

This commit is contained in:
Jenkins 2015-03-28 19:41:37 +00:00 committed by Gerrit Code Review
commit 04ef8ea273
3 changed files with 1 additions and 14 deletions

View File

@ -92,8 +92,7 @@ class FlatTypeDriver(helpers.BaseTypeDriver):
if not physical_network:
msg = _("physical_network required for flat provider network")
raise exc.InvalidInput(error_message=msg)
if (self.flat_networks is not None and
physical_network not in self.flat_networks):
if self.flat_networks and physical_network not in self.flat_networks:
msg = (_("physical_network '%s' unknown for flat provider network")
% physical_network)
raise exc.InvalidInput(error_message=msg)

View File

@ -116,8 +116,6 @@ class Ml2PluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase):
config.cfg.CONF.set_override('network_vlan_ranges',
[self.phys_vrange, self.phys2_vrange],
group='ml2_type_vlan')
config.cfg.CONF.set_override('flat_networks', ['noagent'],
group='ml2_type_flat')
self.setup_parent()
self.driver = ml2_plugin.Ml2Plugin()
self.context = context.get_admin_context()

View File

@ -86,16 +86,6 @@ class FlatTypeTest(testlib_api.SqlTestCase):
self.driver.validate_provider_segment,
segment)
def test_validate_provider_segment_with_empty_physical_nets_list(self):
config.cfg.CONF.set_override('flat_networks', [],
group='ml2_type_flat')
driver = type_flat.FlatTypeDriver()
segment = {api.NETWORK_TYPE: p_const.TYPE_FLAT,
api.PHYSICAL_NETWORK: 'flat_net'}
self.assertRaises(exc.InvalidInput,
driver.validate_provider_segment,
segment)
def test_reserve_provider_segment(self):
segment = {api.NETWORK_TYPE: p_const.TYPE_FLAT,
api.PHYSICAL_NETWORK: 'flat_net1'}