fix performance issue with getNodeIPaddress, the problem is in DBobjUtils->getchildren, but this routine never should have called DBobjUtils->getchildren.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@10972 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav
2011-11-04 18:04:27 +00:00
parent 3b0783e351
commit ec81ac9aa0
+28 -2
View File
@@ -2852,6 +2852,15 @@ sub nodeonmynet
=head3 getNodeIPaddress
Arguments:
Node name only one at a time
Returns: ip address(s)
Globals:
none
Error:
none
Example: my $c1 = xCAT::Utils::getNodeIPaddress($nodetocheck);
=cut
#-------------------------------------------------------------------------------
@@ -2882,8 +2891,25 @@ sub getNodeIPaddress
my $type = xCAT::DBobjUtils->getnodetype($nodetocheck);
if ($type) {
if ($type eq "frame" or $type eq "cec") {
$c1 = xCAT::DBobjUtils->getchildren($nodetocheck);
# Read the ppc table for any entry that
# has parent=nodename and nodetype fsp or bpa
my $ppctab = xCAT::Table->new( 'ppc' );
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
my $parent;
my $node;
my $type;
#search for addresses
for my $entry ( @ps ) {
$parent = $entry->{parent};
$node = $entry->{node};
$type = $entry->{nodetype};
if (defined($parent) and $parent eq $nodetocheck ) {
if ( defined($type) and $type eq 'fsp' or $type eq 'bpa'){
push @$c1,$node;
}
}
}
#if $port exists, only for mkhwconn ... CEC/Frame
if ( defined($port) ) {
my @fsp_bpa = @$c1;