From 9114af09a43705885fd63979a852d56d3bdf53da Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Mon, 26 Jan 2015 18:52:31 -0600 Subject: [PATCH] Ensure ofports are converted to string before trying to use join() Change-Id: Idfe0bf8bedbe4bc165a33f66785eb6b5b38a5a0e Closes-bug: #1415043 --- .../plugins/openvswitch/agent/ovs_neutron_agent.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py index 54c7061e4..6a39c0583 100644 --- a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py @@ -373,7 +373,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, 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" % @@ -393,7 +393,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, 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" % @@ -480,7 +480,8 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, 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, @@ -1049,7 +1050,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, 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(): @@ -1503,6 +1504,10 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, 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. -- 2.45.2