From a7b54d3c60ff6dd63273b573bcc5c572faab22a8 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Tue, 13 Jan 2015 08:05:19 -0800 Subject: [PATCH] Fix topic for provider security group update Commit 8098b6bd20bb12520e438ef9125dc7b96664f712 accidentally changed the topic for the provider security group update to a regular member update. This resulted in the L2 agent not asking for the latest security group rules after a DHCP port was created. If a regular compute port was brought online and wired up by the L2 agent before the DHCP port was created, the VM would never get its allow rule to communicate with the DHCP server. Co-bug-squasher: Armando Closes-Bug: #1403291 Change-Id: I382f2e1390c9a3ff558e152eeb76f0f827266cb4 --- neutron/agent/securitygroups_rpc.py | 2 +- neutron/tests/unit/test_security_groups_rpc.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py index fe678510601..46ceab8497f 100644 --- a/neutron/agent/securitygroups_rpc.py +++ b/neutron/agent/securitygroups_rpc.py @@ -389,4 +389,4 @@ class SecurityGroupAgentRpcApiMixin(object): cctxt = self.client.prepare(version=SG_RPC_VERSION, topic=self._get_security_group_topic(), fanout=True) - cctxt.cast(context, 'security_groups_member_updated') + cctxt.cast(context, 'security_groups_provider_updated') diff --git a/neutron/tests/unit/test_security_groups_rpc.py b/neutron/tests/unit/test_security_groups_rpc.py index eb7b1f9c535..b17ecbeadd9 100644 --- a/neutron/tests/unit/test_security_groups_rpc.py +++ b/neutron/tests/unit/test_security_groups_rpc.py @@ -1644,6 +1644,11 @@ class SecurityGroupAgentRpcApiTestCase(base.BaseTestCase): self.mock_cast = mock.patch.object(self.notifier.client, 'cast').start() + def test_security_groups_provider_updated(self): + self.notifier.security_groups_provider_updated(None) + self.mock_cast.assert_has_calls( + [mock.call(None, 'security_groups_provider_updated')]) + def test_security_groups_rule_updated(self): self.notifier.security_groups_rule_updated( None, security_groups=['fake_sgid'])