def add_fdb_flow(self, br, port_info, remote_ip, lvm, ofport):
if port_info == q_const.FLOODING_ENTRY:
lvm.tun_ofports.add(ofport)
- ofports = ','.join(lvm.tun_ofports)
+ ofports = _ofport_set_to_str(lvm.tun_ofports)
br.mod_flow(table=constants.FLOOD_TO_TUN,
dl_vlan=lvm.vlan,
actions="strip_vlan,set_tunnel:%s,output:%s" %
if port_info == q_const.FLOODING_ENTRY:
lvm.tun_ofports.remove(ofport)
if len(lvm.tun_ofports) > 0:
- ofports = ','.join(lvm.tun_ofports)
+ ofports = _ofport_set_to_str(lvm.tun_ofports)
br.mod_flow(table=constants.FLOOD_TO_TUN,
dl_vlan=lvm.vlan,
actions="strip_vlan,set_tunnel:%s,output:%s" %
if network_type in constants.TUNNEL_NETWORK_TYPES:
if self.enable_tunneling:
# outbound broadcast/multicast
- ofports = ','.join(self.tun_br_ofports[network_type].values())
+ ofports = _ofport_set_to_str(
+ self.tun_br_ofports[network_type].values())
if ofports:
self.tun_br.mod_flow(table=constants.FLOOD_TO_TUN,
dl_vlan=lvid,
actions="resubmit(,%s)" %
constants.TUN_TABLE[tunnel_type])
- ofports = ','.join(self.tun_br_ofports[tunnel_type].values())
+ ofports = _ofport_set_to_str(self.tun_br_ofports[tunnel_type].values())
if ofports and not self.l2_pop:
# Update flooding flows to include the new tunnel
for network_id, vlan_mapping in self.local_vlan_map.iteritems():
self.run_daemon_loop = False
+def _ofport_set_to_str(ofport_set):
+ return ",".join(map(str, ofport_set))
+
+
def create_agent_config_map(config):
"""Create a map of agent config parameters.