Skip to content

Commit

Permalink
Fix Cumulus support of breakout ports
Browse files Browse the repository at this point in the history
The code before was way too picky and complex, when it could
have been simple and forgiving.
  • Loading branch information
jjohnson42 committed Jul 10, 2020
1 parent 89f3770 commit d450d98
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions perl-xCAT/xCAT/MacMap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit d450d98

Please sign in to comment.