]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix handling of before/after notifications in linuxbridge agent
authorEugene Nikanorov <enikanorov@mirantis.com>
Mon, 23 Mar 2015 03:51:06 +0000 (07:51 +0400)
committerEugene Nikanorov <enikanorov@mirantis.com>
Tue, 24 Mar 2015 08:23:17 +0000 (11:23 +0300)
Avoid problem similar to described in bug #1367881

Change-Id: I76059469c20be9161743ba730e46da1789ded4a8
Closes-Bug: #1407887
Related-Bug: #1367881

neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py [changed mode: 0755->0644]
neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py

old mode 100755 (executable)
new mode 100644 (file)
index 8794ddd..50cab5d
@@ -722,11 +722,11 @@ class LinuxBridgeRpcCallbacks(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
                 if agent_ip == self.agent.br_mgr.local_ip:
                     continue
 
-                after = state.get('after')
+                after = state.get('after', [])
                 for mac, ip in after:
                     self.agent.br_mgr.add_fdb_ip_entry(mac, ip, interface)
 
-                before = state.get('before')
+                before = state.get('before', [])
                 for mac, ip in before:
                     self.agent.br_mgr.remove_fdb_ip_entry(mac, ip, interface)
 
index c903170869a16c90fe1ce52d7e9d9f68445fe64c..c80ee67e9a7a3e87dd2663191968b80743cfbef0 100644 (file)
@@ -1059,3 +1059,7 @@ class TestLinuxBridgeRpcCallbacks(base.BaseTestCase):
                           check_exit_code=False)
             ]
             execute_fn.assert_has_calls(expected)
+
+    def test_fdb_update_chg_ip_empty_lists(self):
+        fdb_entries = {'chg_ip': {'net_id': {'agent_ip': {}}}}
+        self.lb_rpc.fdb_update(None, fdb_entries)