diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 69a04e01d..2dddc2d6c 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -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;