From d450d982d73fd73984523f0892cf1495e13cd1e2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 10 Jul 2020 08:21:26 -0400 Subject: [PATCH] Fix Cumulus support of breakout ports The code before was way too picky and complex, when it could have been simple and forgiving. --- perl-xCAT/xCAT/MacMap.pm | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index a3cf3acbec..f6f939cbd4 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -733,30 +733,12 @@ sub refresh_switch { } }else{ foreach (@res){ - if($_ =~ m/^([0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}) dev swp([0-9]+) vlan ([0-9]+) .*/){ + if($_ =~ m/^([0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}) dev (swp[^ ]+) vlan ([0-9]+) .*/){ $mymac=$1; $myport=$2; - $myport=sprintf("%d",$myport); my $macport=$2; my $macvlan=$3; - #try all the possible port number formats - #e.g, "5","swp5","05","swp05" - unless(exists $self->{switches}->{$switch}->{$myport}){ - if(exists $self->{switches}->{$switch}->{"swp".$myport}){ - $myport="swp".$myport; - }else{ - $myport=sprintf("%02d",$myport); - unless(exists $self->{switches}->{$switch}->{$myport}){ - if(exists $self->{switches}->{$switch}->{"swp".$myport}){ - $myport="swp".$myport; - }else{ - $myport=""; - } - } - } - } - if($myport){ if($output){ printf $output "$mymac|%s\n", $self->{switches}->{$switch}->{$myport};