From dc818423702c4fdd4822152dd90705bfa73f211e Mon Sep 17 00:00:00 2001 From: sakolish Date: Fri, 13 Jun 2008 15:49:08 +0000 Subject: [PATCH] More changes for multiple keys in "deps" table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1658 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index c73d25df2..12c6ede01 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1288,21 +1288,17 @@ sub build_depend { unless ($mptab) { return("Cannot open mp table"); } - my @ent = $depstab->getAllNodeAttribs( [qw(node nodedep msdelay cmd)] ); - if (!@ent) { - return([\%dp]); - } foreach my $node (@$noderange) { my $delay = 0; my $dep; + my @ent = $depstab->getNodeAttribs($node,[qw(nodedep msdelay cmd)]); foreach my $h ( @ent ) { - if (( $h->{node} eq $node ) and - ( grep(/^@$exargs[0]$/, split /,/, $h->{cmd} ))) { - if (exists($h->{nodedep})) { $dep=$h->{nodedep}; } - if (exists($h->{msdelay})) { $delay=$h->{msdelay}; } - last; + if ( grep(/^@$exargs[0]$/, split /,/, $h->{cmd} )) { + if (exists($h->{nodedep})) { $dep=$h->{nodedep}; } + if (exists($h->{msdelay})) { $delay=$h->{msdelay}; } + last; } } if (!defined($dep)) { @@ -1313,7 +1309,7 @@ sub build_depend { if ( !grep( /^$n$/, @$noderange )) { return( "Missing dependency on command-line: $node -> $n" ); } elsif ( $n eq $node ) { - return( "Node dependent on itself: $n -> $node" ); + next; # ignore multiple levels } $dp{$n}{$node} = $delay; }