From 288990c73d7ed7044e76eeb21631dbdbd981f12d Mon Sep 17 00:00:00 2001 From: yinle Date: Thu, 6 Jan 2011 08:11:27 +0000 Subject: [PATCH] FSP/BPA redundancy: fix a mistake git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8567 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DBobjUtils.pm | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index acd53e782..653c4670b 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -2076,7 +2076,7 @@ sub getchildren my $c = $entry->{node}; if ( $p and $c) { my $type = $ppctab->getNodeAttribs($c, ["nodetype"]); - if ( $type and ($type->{nodetype} ne 'cec')) + if ( $type and ($type->{nodetype} eq 'fsp') or ($type->{nodetype} eq 'bpa')) { push @{$::PARENT_CHILDREN{$p}}, $c; } @@ -2190,7 +2190,7 @@ sub getnodetype =head3 getcecchildren returns cec of the specified frame, Arguments: - none + frame name Returns: refrence of cec hostnames Globals: @@ -2214,28 +2214,32 @@ sub getcecchildren my @children = (); if (!%::PARENT_CHILDREN_CEC) { my $ppctab = xCAT::Table->new( 'ppc' ); - my @ps = $ppctab->getAllNodeAttribs(['node','parent']); - for my $entry ( @ps ) { - my $p = $entry->{parent}; - my $c = $entry->{node}; - if ( $p and $c) { - my $type = $ppctab->getNodeAttribs($c, ["nodetype"]); - if ( $type and ($type->{nodetype} eq 'cec')) - { - push @{$::PARENT_CHILDREN_CEC{$p}}, $c; + if ($ppctab) + { + my @ps = $ppctab->getAllNodeAttribs(['node','parent']); + for my $entry ( @ps ) { + my $p = $entry->{parent}; + my $c = $entry->{node}; + if ( $p and $c) { + my $type = $ppctab->getNodeAttribs($c, ["nodetype"]); + if ( $type and ($type->{nodetype} eq 'cec')) { + push @{$::PARENT_CHILDREN_CEC{$p}}, $c; + } } + } + foreach (@{$::PARENT_CHILDREN_CEC{$parent}}) { + push @children, $_; } - } - foreach (@{$::PARENT_CHILDREN_CEC{$parent}}) { - push @children, $_; - } + return \@children; + } } else { if (exists($::PARENT_CHILDREN_CEC{$parent})) { foreach (@{$::PARENT_CHILDREN_CEC{$parent}}) { push @children, $_; } + return \@children; } } - return \@children; + return undef; } 1;