]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Make lb mechanism driver use enable_security_group flag
authorDarragh O'Reilly <darragh.oreilly@hp.com>
Wed, 3 Dec 2014 19:51:16 +0000 (19:51 +0000)
committerDarragh O'Reilly <darragh.oreilly@hp.com>
Wed, 7 Jan 2015 09:46:01 +0000 (09:46 +0000)
This patch allows Neutron security groups to be enabled or
disabled with the enable_security_group flag when using the
linuxbridge ml2 mechanism driver.

Closes-Bug: #1398996
Change-Id: I883c67c93e85668cd9d90b0486e448d906fdf8ed

neutron/plugins/ml2/drivers/mech_linuxbridge.py

index 2c52c2950b23bb4e02500339580f3301376e60c5..11d82d766e5a94c0cc812fdb3bcea3d73ed1c88d 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from neutron.agent import securitygroups_rpc
 from neutron.common import constants
 from neutron.extensions import portbindings
 from neutron.i18n import _LW
@@ -34,10 +35,11 @@ class LinuxbridgeMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
     """
 
     def __init__(self):
+        sg_enabled = securitygroups_rpc.is_firewall_enabled()
         super(LinuxbridgeMechanismDriver, self).__init__(
             constants.AGENT_TYPE_LINUXBRIDGE,
             portbindings.VIF_TYPE_BRIDGE,
-            {portbindings.CAP_PORT_FILTER: True})
+            {portbindings.CAP_PORT_FILTER: sg_enabled})
 
     def check_segment_for_agent(self, segment, agent):
         mappings = agent['configurations'].get('interface_mappings', {})