From: Sam Hague Date: Fri, 2 May 2014 18:08:09 +0000 (-0400) Subject: Allow vlan type usage for OpenDaylight ml2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3758f25c3ca83d9465f7a0041f286156504c7065;p=openstack-build%2Fneutron-build.git Allow vlan type usage for OpenDaylight ml2 The initial OpenDaylight integration with Openstack did not support vlan isolation so it was not included as a valid type. This change adds the vlan type as allowed. Also modified tests to include vlan as supported in the check_segment(). DocImpact: Use of VLANs with ML2 and the OpenDaylight mechanism driver requires OpenDaylight Helium or newer to be installed. Closes-Bug: #1315475 Change-Id: I52e3c9bfdc93b8786c58954beca105e7498e3f40 --- diff --git a/neutron/plugins/ml2/drivers/mechanism_odl.py b/neutron/plugins/ml2/drivers/mechanism_odl.py index d4e92334f..416e870d1 100644 --- a/neutron/plugins/ml2/drivers/mechanism_odl.py +++ b/neutron/plugins/ml2/drivers/mechanism_odl.py @@ -371,4 +371,4 @@ class OpenDaylightMechanismDriver(api.MechanismDriver): """ network_type = segment[api.NETWORK_TYPE] return network_type in [constants.TYPE_LOCAL, constants.TYPE_GRE, - constants.TYPE_VXLAN] + constants.TYPE_VXLAN, constants.TYPE_VLAN] diff --git a/neutron/tests/unit/ml2/test_mechanism_odl.py b/neutron/tests/unit/ml2/test_mechanism_odl.py index 5b58c4f6d..472387c20 100644 --- a/neutron/tests/unit/ml2/test_mechanism_odl.py +++ b/neutron/tests/unit/ml2/test_mechanism_odl.py @@ -57,7 +57,7 @@ class OpenDaylightTestCase(test_plugin.NeutronDbPluginV2TestCase): self.segment[api.NETWORK_TYPE] = constants.TYPE_FLAT self.assertFalse(self.mech.check_segment(self.segment)) self.segment[api.NETWORK_TYPE] = constants.TYPE_VLAN - self.assertFalse(self.mech.check_segment(self.segment)) + self.assertTrue(self.mech.check_segment(self.segment)) self.segment[api.NETWORK_TYPE] = constants.TYPE_GRE self.assertTrue(self.mech.check_segment(self.segment)) self.segment[api.NETWORK_TYPE] = constants.TYPE_VXLAN