diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index 413356600..4e9d163e5 100644 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -615,6 +615,10 @@ sub format_output { } ########################################### + if ( exists( $globalopt{i} )) { + my $outhash1 = filtersamevlan( $outhash ); + $outhash = $outhash1; + } # filter the result and keep the specified nodes ########################################### if ( scalar(@filternodes)) { @@ -1634,7 +1638,6 @@ sub filter { # Filter nodes not in the user specified vlan ########################################################################## sub filtersamevlan { - my $request = shift; my $oldhash = shift; my $newhash; my $nets = xCAT::Utils::my_nets(); @@ -1647,12 +1650,12 @@ sub filtersamevlan { } } foreach my $name ( keys %$oldhash ) { - if ($name->{type} =~ /^(fsp|bpa)$/) { - my $ip = $name->{ip}; + if (${$oldhash->{$name}}{type} =~ /^(fsp|bpa)$/) { + my $ip = ${$oldhash->{$name}}{ip}; for my $net ( keys %$validnets){ my ($n,$m) = split /\//,$net; - if ( xCAT::Utils::isInSameSubnet( $n, $ip, $m, 1) and xCAT::Utils::isPingable( $ip)) { - $newhash->{$name} = ${$oldhash->{$name}}{hostname}; + if ( xCAT::Utils::isInSameSubnet( $n, $ip, $m, 1)) {#and xCAT::Utils::isPingable( $ip)) { + $newhash->{$name} = $oldhash->{$name}; } } } else {