From e0e4031f688885a0582a6baf90b3ea2b284e8db8 Mon Sep 17 00:00:00 2001 From: yinle Date: Fri, 15 Mar 2013 07:50:43 +0000 Subject: [PATCH] fix bug 3428: lsslp -n does not check xCAT DB properly for current objects git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15530 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/lsslp.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index 3e084f6b2..d3261924d 100644 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -1222,6 +1222,8 @@ sub parse_responses { bpcmtm to ${$outhash{$name}}{bpcmtm}, bpcsn to ${$outhash{$name}}{bpcsn}"); } + } + } ########################################################### # find frame's hostname first, then use find the cec's parent @@ -1284,7 +1286,7 @@ sub parse_responses { trace( $request, "\n\n\nBegin to find fsp/bpa's hostname and parent"); foreach my $h ( keys %outhash ) { # Added a skip if processing Flex blades - if(((${$outhash{$h}}{type} eq TYPE_FSP) && ${$outhash{$h}}{mtm} !~ /^7895|1457/ ) or ${$outhash{$h}}{type} eq TYPE_BPA) { + if(${$outhash{$h}}{type} eq TYPE_FSP or ${$outhash{$h}}{type} eq TYPE_BPA) { $newhostname = $::OLD_DATA_CACHE{${$outhash{$h}}{type}."*".${$outhash{$h}}{mtm}.'*'.${$outhash{$h}}{serial}.'*'.${$outhash{$h}}{side}}; if ($newhostname){ ${$outhash{$h}}{hostname} = $newhostname ; @@ -1292,7 +1294,7 @@ sub parse_responses { push @matchnode, $h; } my $ptmp = ${$outhash{$h}}{parent}; - ${$outhash{$h}}{parent} = ${$outhash{$ptmp}}{hostname}; + ${$outhash{$h}}{parent} = ${$outhash{$ptmp}}{hostname} unless((${$outhash{$h}}{type} eq TYPE_FSP) && ${$outhash{$h}}{mtm} =~ /^7895|1457/ ); trace( $request, "$h found parent ${$outhash{$ptmp}}{hostname}"); #check if fsp/bpa's ip is valid my $vip = check_ip(${$outhash{$h}}{ip}); @@ -1309,8 +1311,6 @@ sub parse_responses { ${$outhash{$child}}{fid} = ${$outhash{$h}}{fid}; ${$outhash{$child}}{cid} = ${$outhash{$h}}{cid}; trace( $request, "child is $child, fid is ${$outhash{$child}}{fid}, cid is ${$outhash{$child}}{cid}"); - } - } } } # end - process fsp and bpa @@ -1352,7 +1352,9 @@ sub parse_responses { } send_msg ( $request, 0, "These nodes defined in database but can't be discovered: $notdisnode \n"); } - + foreach my $no(keys %outhash) { + delete $outhash{$no} unless ( ${$outhash{$no}}{hostname} ); + } return \%outhash; } ##########################################################################