]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix ovs-vsctl call in add_tunnel_port()
authorRoman Podolyaka <rpodolyaka@mirantis.com>
Thu, 19 Sep 2013 13:57:49 +0000 (16:57 +0300)
committerRoman Podolyaka <rpodolyaka@mirantis.com>
Thu, 19 Sep 2013 14:49:37 +0000 (17:49 +0300)
When a new GRE tunnel is created OVS agent calls ovs-vsctl
incorrectly. Command:

    sudo ovs-vsctl --timeout=2 --may-exist add-port br-tun gre-1

is produced instead of correct one:

   sudo ovs-vsctl --timeout=2 -- --may-exist add-port br-tun gre-1

Fixes bug 1227675

Change-Id: I010961658a37028e41621c4a529b5a14e7587c7f

neutron/agent/linux/ovs_lib.py
neutron/tests/unit/openvswitch/test_ovs_lib.py

index ad94ef4399dd18a222fabb647e2fb5798cff1e8e..097630707aee0a41000cbb25fe58fb83129e96a5 100644 (file)
@@ -207,7 +207,8 @@ class OVSBridge:
     def add_tunnel_port(self, port_name, remote_ip, local_ip,
                         tunnel_type=constants.TYPE_GRE,
                         vxlan_udp_port=constants.VXLAN_UDP_PORT):
-        self.run_vsctl(["--may-exist", "add-port", self.br_name, port_name])
+        self.run_vsctl(["--", "--may-exist", "add-port", self.br_name,
+                       port_name])
         self.set_db_attribute("Interface", port_name, "type", tunnel_type)
         if tunnel_type == constants.TYPE_VXLAN:
             # Only set the VXLAN UDP port if it's not the default
index 0a2908f2fbd1aab995e488b41fdb5aa0568ea39b..d4fef53e6ad96c450a83fb776a86432fbc4e2c60 100644 (file)
@@ -219,7 +219,7 @@ class OVS_Lib_Test(base.BaseTestCase):
         remote_ip = "9.9.9.9"
         ofport = "6"
 
-        utils.execute(["ovs-vsctl", self.TO, "--may-exist", "add-port",
+        utils.execute(["ovs-vsctl", self.TO, '--', "--may-exist", "add-port",
                        self.BR_NAME, pname], root_helper=self.root_helper)
         utils.execute(["ovs-vsctl", self.TO, "set", "Interface",
                        pname, "type=gre"], root_helper=self.root_helper)