Make ovs Interface option set properly.

Multiple ovs-vsctl set Interface option call overrides the previous
settings and result in unexpected partial condition.

Change-Id: I62b3bd6ea9adac7c1f4995fc18af9838a7e25b43
This commit is contained in:
KAWAI Hiroaki 2012-04-25 21:25:32 +09:00 committed by KAWAI Hiroaki
parent bb49ab0a0c
commit fc3cb0968d

View File

@ -127,17 +127,17 @@ class OVSBridge:
def add_tunnel_port(self, port_name, remote_ip): def add_tunnel_port(self, port_name, remote_ip):
self.run_vsctl(["add-port", self.br_name, port_name]) self.run_vsctl(["add-port", self.br_name, port_name])
self.set_db_attribute("Interface", port_name, "type", "gre") self.set_db_attribute("Interface", port_name, "type", "gre")
self.set_db_attribute("Interface", port_name, "options", "remote_ip=" + self.set_db_attribute("Interface", port_name, "options:remote_ip",
remote_ip) remote_ip)
self.set_db_attribute("Interface", port_name, "options", "in_key=flow") self.set_db_attribute("Interface", port_name, "options:in_key", "flow")
self.set_db_attribute("Interface", port_name, "options", self.set_db_attribute("Interface", port_name, "options:out_key",
"out_key=flow") "flow")
return self.get_port_ofport(port_name) return self.get_port_ofport(port_name)
def add_patch_port(self, local_name, remote_name): def add_patch_port(self, local_name, remote_name):
self.run_vsctl(["add-port", self.br_name, local_name]) self.run_vsctl(["add-port", self.br_name, local_name])
self.set_db_attribute("Interface", local_name, "type", "patch") self.set_db_attribute("Interface", local_name, "type", "patch")
self.set_db_attribute("Interface", local_name, "options", "peer=" + self.set_db_attribute("Interface", local_name, "options:peer",
remote_name) remote_name)
return self.get_port_ofport(local_name) return self.get_port_ofport(local_name)