]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
l2-population/lb/vxlan : ip neigh add command failed
authormathieu-rohon <mathieu.rohon@gmail.com>
Thu, 20 Feb 2014 16:39:00 +0000 (17:39 +0100)
committerThomas Goirand <thomas@goirand.fr>
Thu, 13 Mar 2014 07:20:32 +0000 (15:20 +0800)
we were using ip neigh add command which must be replaced by
ip neigh replace, to avoid error when creating a VM with an ip
previously used by a deleted VM

Change-Id: I2405096d5925ae37efd5f8abcc02b99cf0c9f5d3
Closes-Bug: #1282662

neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py

index 7cb41400bf51d56c5d5c451a7292cba4ed47ed23..1eb2ced5128e6985c5452f35f287493f0296ec04 100755 (executable)
@@ -566,7 +566,7 @@ class LinuxBridgeManager:
         return (agent_ip in entries and mac in entries)
 
     def add_fdb_ip_entry(self, mac, ip, interface):
-        utils.execute(['ip', 'neigh', 'add', ip, 'lladdr', mac,
+        utils.execute(['ip', 'neigh', 'replace', ip, 'lladdr', mac,
                        'dev', interface, 'nud', 'permanent'],
                       root_helper=self.root_helper,
                       check_exit_code=False)
index ca979fc53afb4fe3c820f2af30e0662303ad726b..a1ce13a6e6fe2f37ab5317393763268ae29f0a39 100644 (file)
@@ -899,7 +899,7 @@ class TestLinuxBridgeRpcCallbacks(base.BaseTestCase):
                            'dev', 'vxlan-1', 'dst', 'agent_ip'],
                           root_helper=self.root_helper,
                           check_exit_code=False),
-                mock.call(['ip', 'neigh', 'add', 'port_ip', 'lladdr',
+                mock.call(['ip', 'neigh', 'replace', 'port_ip', 'lladdr',
                            'port_mac', 'dev', 'vxlan-1', 'nud', 'permanent'],
                           root_helper=self.root_helper,
                           check_exit_code=False),
@@ -980,7 +980,7 @@ class TestLinuxBridgeRpcCallbacks(base.BaseTestCase):
             self.lb_rpc.fdb_update(None, fdb_entries)
 
             expected = [
-                mock.call(['ip', 'neigh', 'add', 'port_ip_2', 'lladdr',
+                mock.call(['ip', 'neigh', 'replace', 'port_ip_2', 'lladdr',
                            'port_mac', 'dev', 'vxlan-1', 'nud', 'permanent'],
                           root_helper=self.root_helper,
                           check_exit_code=False),