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

This reverts commit dbe37d5714.

This validation change broke TripleO's os-cloud-config
setup-neutron script.

Change-Id: I94c419b26ba93c67c9064fc110c8986c1ff68897
Closes-bug: #1437116
This commit is contained in:
Dan Prince 2015-03-26 22:19:58 -04:00
parent 0c2cf8b460
commit 3f0c2b552a
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'}