From d7ff87a0063f3dbe6cfdd2f361d43efa45da3932 Mon Sep 17 00:00:00 2001 From: yinle Date: Sat, 11 Aug 2012 06:26:25 +0000 Subject: [PATCH] Fix bug 3555910: lsslp -i gives reduntant info which is not specified by -i git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13484 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/lsslp.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 {