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
This commit is contained in:
yinle 2011-03-20 06:56:10 +00:00
parent c5841edbc4
commit 25a778e399

View File

@ -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;