From 2e13e8eb53ecd30ea630dbecb196dbdb27ee1c9a Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 9 May 2019 09:25:51 +0000 Subject: [PATCH] =?UTF-8?q?B=20#3305:=20OpenvSwitch=20=E2=80=9Cdel=5Fflows?= =?UTF-8?q?=E2=80=9D=20traceback=20(#3304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “del_flows” override the loop variable “m” when matching the port, on the second loop which result in the following error. /var/tmp/one/vnm/ovswitch/OpenvSwitch.rb:287:in `match': wrong argument type MatchData (expected Regexp) (TypeError) * src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb: use a different variable name when matching the port than the loop iterator. Signed-off-by: Daniel Dehennin --- src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb index 464f370e71..f6409afa8a 100644 --- a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb +++ b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb @@ -284,12 +284,12 @@ class OpenvSwitchVLAN < VNMMAD::VNMDriver # searching for flow just by MAC address is legacy, # we preferably look for a flow port with our note - ["note:#{port_note}", @nic[:mac]].each do |m| + ["note:#{port_note}", @nic[:mac]].each do |flow_matching| out_flows.lines do |flow| - next unless flow.match(m) + next unless flow.match(flow_matching) - if (m = flow.match(/in_port=(\d+)/)) - in_port_tmp = m[1] + if (port_match = flow.match(/in_port=(\d+)/)) + in_port_tmp = port_match[1] if !the_ports.include?(in_port_tmp) in_port = in_port_tmp