From 25a778e399c071c726a95ae500c5f14888e9550a Mon Sep 17 00:00:00 2001 From: yinle Date: Sun, 20 Mar 2011 06:56:10 +0000 Subject: [PATCH] Fix bug 3212767: "lsdef -l"& nodels shouldn't display hidden info. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9108 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/tabutils.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index ceedc2dc9..c68c90e1b 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -1542,6 +1542,25 @@ sub nodels # TODO - gather data for each node # for now just return the flattened list of nodes) my $rsp; #build up fewer requests, be less chatty + + #-S will make nodels not show FSPs and BPAs + my @newnodes = (); + if (!defined($HIDDEN)) + { + my $listtab = xCAT::Table->new( 'nodelist' ); + if ($listtab) { + my $listHash = $listtab->getNodesAttribs(\@$nodes, ['hidden']); + foreach my $rnode(@$nodes) { + unless (defined($listHash->{$rnode}->[0]->{hidden})){ + push (@newnodes, $rnode); + } elsif ($listHash->{$rnode}->[0]->{hidden} ne 1) { + push (@newnodes, $rnode); + } + } + } + $nodes = \@newnodes; + } + if ($argc) { my %tables;