File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 55use Storable;
66use Data::Dump qw( dump) ;
77
8+ $| =1;
9+
810my $gv = Storable::retrieve( ' /tmp/gv.storable' );
11+ delete $gv -> {' sw-core' }-> {$_ } foreach 7 .. 10; # remove sw-b101 lacp
912warn " # gv = " ,dump ( $gv );
1013
1114my @sw = qw( sw-core ) ;
2831warn " XX $sw " ;
2932 foreach my $port ( sort { $a <=> $b } keys %$s ) {
3033 my $to_sw = ( keys %{ $s -> {$port } } )[0];
31- my $to_port = ( keys %{ $s -> {$port }-> {$to_sw } } )[0];
34+ my @to_ports = keys %{ $s -> {$port }-> {$to_sw } } ;
35+ my $to_port = $to_ports [0];
36+
37+ if ( scalar @to_ports > 1 ) {
38+ warn " ERROR $sw $port -- $to_sw more than one destination port " ,dump ( @to_ports );
39+ }
3240
3341 next if $to_port eq ' no_port' ;
3442
3846
3947 print " $prefix $sw $port $to_sw $to_port \n " ;
4048
49+ next if $done_sw -> {$to_sw };
50+
4151 if ( $to_sw =~ m / ^sw-/ ) {
4252 push @prefix , " $prefix $sw $port $to_sw $to_port " ;
4353 push @sw , $to_sw ;
You can’t perform that action at this time.
0 commit comments