]> 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)
committermathieu-rohon <mathieu.rohon@gmail.com>
Tue, 25 Feb 2014 10:11:23 +0000 (11:11 +0100)
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 6bf1e05d23b36101037fafc8944dd417c490ad27..e974ef2dc292ee9ba0e561f017481710142d71e3 100755 (executable)
@@ -564,7 +564,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 0687d023ecb5d65f7a29bb11e4b216742ef84285..629ab338cff94146a517b3d127950d14a5f9dc1c 100644 (file)
@@ -863,7 +863,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),
@@ -944,7 +944,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),