Merge "Allow virtual tunnel ports to also have virtual sources"

This commit is contained in:
Zuul 2018-11-08 12:13:58 +00:00 committed by Gerrit Code Review
commit 8178c50580
3 changed files with 9 additions and 6 deletions

View File

@ -56,11 +56,14 @@ class GetBridgePorts(commands.BaseCommand):
class AddVirtualTunnelPort(commands.BaseCommand):
def __init__(self, api, tunnel_type):
def __init__(self, api, tunnel_type, local_ip=None):
super(AddVirtualTunnelPort, self).__init__(api)
self.tunnel_type = tunnel_type
self.integration_bridge = cfg.CONF.df.integration_bridge
self.port = tunnel_type + "-vtp"
self.local_ip = local_ip
if local_ip is None:
self.local_ip = cfg.CONF.df.local_ip
def run_idl(self, txn):
port = idlutils.row_by_value(self.api.idl, 'Port', 'name',
@ -85,7 +88,7 @@ class AddVirtualTunnelPort(commands.BaseCommand):
options_dict = getattr(iface, 'options', {})
options_dict['remote_ip'] = 'flow'
options_dict['key'] = 'flow'
options_dict['local_ip'] = cfg.CONF.df.local_ip
options_dict['local_ip'] = self.local_ip
iface.options = options_dict
port.verify('interfaces')
ifaces = getattr(port, 'interfaces', [])

View File

@ -203,8 +203,8 @@ class DFOvsdbApi(impl_idl.OvsdbIdl):
def add_patch_port(self, bridge, port, peer_port):
return commands.AddPatchPort(self, bridge, port, peer_port)
def add_virtual_tunnel_port(self, tunnel_type):
return commands.AddVirtualTunnelPort(self, tunnel_type)
def add_virtual_tunnel_port(self, tunnel_type, local_ip=None):
return commands.AddVirtualTunnelPort(self, tunnel_type, local_ip)
def create_qos(self, port_id, qos):
return commands.CreateQos(self, port_id, qos)

View File

@ -111,8 +111,8 @@ class OvsApi(object):
return tunnel_ports
def add_virtual_tunnel_port(self, tunnel_type):
self.ovsdb.add_virtual_tunnel_port(tunnel_type).execute()
def add_virtual_tunnel_port(self, tunnel_type, local_ip=None):
self.ovsdb.add_virtual_tunnel_port(tunnel_type, local_ip).execute()
def delete_port(self, switch_port):
self.ovsdb.del_port(switch_port.name,