From 01eb78d7c00cde709d08e2d867fc79f93fa7fadf Mon Sep 17 00:00:00 2001 From: linggao Date: Tue, 15 Apr 2008 18:34:31 +0000 Subject: [PATCH] more work on hierarchical support in blade.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1068 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/blade.pm | 26 +++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/blade.pm b/xCAT-server-2.0/lib/xcat/plugins/blade.pm index 1e68c7492..30c60e369 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/blade.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/blade.pm @@ -1225,21 +1225,19 @@ sub preprocess_request { #get the MMs for the nodes for the nodes in order to figure out which service nodes to send the requests to my $mptab = xCAT::Table->new("mp"); - unless ($mptab) { return 2; } - my @all = $mptab->getAllNodeAttribs([qw(node, mpa)]); + unless ($mptab) { + $callback->("Cannot open mp table"); + $request = {}; + return; + } my %mpa_hash=(); - my %input_hash=(); - foreach (@$noderange) { $input_hash{$_}=1;} - foreach (@all) { - if ($input_hash{$_->{node}}) { - push @{$mpa_hash{$_->{mpa}}}, $_->{node}; - $input_hash{$_->{node}}=0; - next; - } - if ($input_hash{$_->{mpa}}) { - push @{$mpa_hash{$_->{mpa}}}, $_->{mpa}; - $input_hash{$_->{mpa}}=0; - next; + foreach my $node (@$noderange) { + my $ent=$mptab->getNodeAttribs($node,['mpa']); + if (defined($ent->{mpa})) { push @{$mpa_hash{$ent->{mpa}}}, $node;} + else { + $callback->("no mpa defined for node $node"); + $request = {}; + return; } }