performance improvement. collect the CEC/Frames' Children in preprocess_nodes() of PPC.pm, instead of getIPaddress() in Utils.pm

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12272 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-04-19 10:27:49 +00:00
parent 843c7c1d5d
commit 8b06f55eb8

View File

@ -2949,24 +2949,25 @@ sub getIPaddress
} else {
return undef;
}
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
my $tmp_parent;
my $tmp_node;
my $tmp_type;
#my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
#my $tmp_parent;
#my $tmp_node;
#my $tmp_type;
#search for $nodetocheck's children or brothers
for my $entry ( @ps ) {
$tmp_parent = $entry->{parent};
$tmp_node = $entry->{node};
$tmp_type = $entry->{nodetype};
if ($tmp_parent and ($tmp_parent eq $parent) ) {
if (!defined($tmp_type)) {
$tmp_type = xCAT::DBobjUtils->getnodetype($tmp_node);
}
if ($tmp_type and ($tmp_type eq 'fsp' or $tmp_type eq 'bpa')) {
push @children, $tmp_node;
}
}
}
#for my $entry ( @ps ) {
# $tmp_parent = $entry->{parent};
# $tmp_node = $entry->{node};
# $tmp_type = $entry->{nodetype};
# if ($tmp_parent and ($tmp_parent eq $parent) ) {
# if (!defined($tmp_type)) {
# $tmp_type = xCAT::DBobjUtils->getnodetype($tmp_node);
# }
# if ($tmp_type and ($tmp_type eq 'fsp' or $tmp_type eq 'bpa')) {
# push @children, $tmp_node;
# }
# }
#}
@children = split(/,/, $::CEC_FRAME_CHILDREN{$parent});
foreach my $tmp_n( @children) {
my $ent = $vpdtab->getNodeAttribs($tmp_n, ['side']);
if ($ent->{side} and $ent->{side} =~ /^$side-$port$/i) {