diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py index 433bd8c9d30..f0d4953d3d9 100644 --- a/neutron/agent/securitygroups_rpc.py +++ b/neutron/agent/securitygroups_rpc.py @@ -33,24 +33,7 @@ LOG = logging.getLogger(__name__) sc_cfg.register_securitygroups_opts() -#This is backward compatibility check for Havana -def _is_valid_driver_combination(): - return ((cfg.CONF.SECURITYGROUP.enable_security_group and - (cfg.CONF.SECURITYGROUP.firewall_driver and - cfg.CONF.SECURITYGROUP.firewall_driver != - 'neutron.agent.firewall.NoopFirewallDriver')) or - (not cfg.CONF.SECURITYGROUP.enable_security_group and - (cfg.CONF.SECURITYGROUP.firewall_driver == - 'neutron.agent.firewall.NoopFirewallDriver' or - cfg.CONF.SECURITYGROUP.firewall_driver is None) - )) - - def is_firewall_enabled(): - if not _is_valid_driver_combination(): - LOG.warning(_LW("Driver configuration doesn't match with " - "enable_security_group")) - return cfg.CONF.SECURITYGROUP.enable_security_group @@ -80,9 +63,6 @@ class SecurityGroupAgentRpc(object): integration_bridge=None): firewall_driver = cfg.CONF.SECURITYGROUP.firewall_driver or 'noop' LOG.debug("Init firewall settings (driver=%s)", firewall_driver) - if not _is_valid_driver_combination(): - LOG.warning(_LW("Driver configuration doesn't match " - "with enable_security_group")) firewall_class = firewall.load_firewall_driver_class(firewall_driver) try: self.firewall = firewall_class( diff --git a/neutron/tests/unit/agent/test_securitygroups_rpc.py b/neutron/tests/unit/agent/test_securitygroups_rpc.py index 3673ea4db82..8321d971bb1 100644 --- a/neutron/tests/unit/agent/test_securitygroups_rpc.py +++ b/neutron/tests/unit/agent/test_securitygroups_rpc.py @@ -2854,33 +2854,3 @@ class TestSecurityGroupExtensionControl(base.BaseTestCase): ext_aliases = ['dummy1', 'security-group', 'dummy2'] sg_rpc.disable_security_group_extension_by_config(ext_aliases) self.assertEqual(ext_aliases, exp_aliases) - - def test_is_invalid_drvier_combination_sg_enabled(self): - set_enable_security_groups(True) - set_firewall_driver(FIREWALL_NOOP_DRIVER) - self.assertFalse(sg_rpc._is_valid_driver_combination()) - - def test_is_invalid_drvier_combination_sg_enabled_with_none(self): - set_enable_security_groups(True) - set_firewall_driver(None) - self.assertFalse(sg_rpc._is_valid_driver_combination()) - - def test_is_invalid_drvier_combination_sg_disabled(self): - set_enable_security_groups(False) - set_firewall_driver('NonNoopDriver') - self.assertFalse(sg_rpc._is_valid_driver_combination()) - - def test_is_valid_drvier_combination_sg_enabled(self): - set_enable_security_groups(True) - set_firewall_driver('NonNoopDriver') - self.assertTrue(sg_rpc._is_valid_driver_combination()) - - def test_is_valid_drvier_combination_sg_disabled(self): - set_enable_security_groups(False) - set_firewall_driver(FIREWALL_NOOP_DRIVER) - self.assertTrue(sg_rpc._is_valid_driver_combination()) - - def test_is_valid_drvier_combination_sg_disabled_with_none(self): - set_enable_security_groups(False) - set_firewall_driver(None) - self.assertTrue(sg_rpc._is_valid_driver_combination())