From 1353927d12ae6d5970d435e68a73403030785b7e Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 2 Mar 2017 02:11:42 -0800 Subject: [PATCH] Remove network port special-case in provisioning block Since the merge of I607635601caff0322fd0c80c9023f5c4f663ca25, DHCP agents now receive all port update/create events so we no longer need to special-case network ports in this function. Related-Bug: #1621345 Related-Bug: #1605955 Related-Bug: #1590845 Change-Id: I4b1cfcfee7441e63370ff3e61f75c119b34cc0fd --- neutron/plugins/ml2/plugin.py | 5 ----- neutron/tests/unit/plugins/ml2/test_plugin.py | 7 ------- 2 files changed, 12 deletions(-) diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index f59bcdc4ade..50afc3d9218 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -1015,11 +1015,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, raise psec.PortSecurityAndIPRequiredForSecurityGroups() def _setup_dhcp_agent_provisioning_component(self, context, port): - # NOTE(kevinbenton): skipping network ports is a workaround for - # the fact that we don't issue dhcp notifications from internal - # port creation like router ports and dhcp ports via RPC - if utils.is_port_trusted(port): - return subnet_ids = [f['subnet_id'] for f in port['fixed_ips']] if (db.is_dhcp_active_on_any_subnet(context, subnet_ids) and any(self.get_configuration_dict(a).get('notifies_port_ready') diff --git a/neutron/tests/unit/plugins/ml2/test_plugin.py b/neutron/tests/unit/plugins/ml2/test_plugin.py index ba550efa8f6..091f0b53f87 100644 --- a/neutron/tests/unit/plugins/ml2/test_plugin.py +++ b/neutron/tests/unit/plugins/ml2/test_plugin.py @@ -757,13 +757,6 @@ class TestMl2PortsV2(test_plugin.TestPortsV2, Ml2PluginV2TestCase): with self.port(): self.assertTrue(ap.called) - def test_dhcp_provisioning_blocks_skipped_with_network_port(self): - self._add_fake_dhcp_agent() - with mock.patch.object(provisioning_blocks, - 'add_provisioning_component') as ap: - with self.port(device_owner=constants.DEVICE_OWNER_DHCP): - self.assertFalse(ap.called) - def test_dhcp_provisioning_blocks_skipped_on_create_with_no_dhcp(self): self._add_fake_dhcp_agent() with self.subnet(enable_dhcp=False) as subnet: