From 05f5dbc5ebd4ecd2c6cfe6d241b12b72e724d9b9 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 29 Nov 2007 21:57:24 +0000 Subject: [PATCH] Fix bug where nodeset install on a range would end up with a malformed state description git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@102 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/usr/lib/xcat/plugins/destiny.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-server-2.0/usr/lib/xcat/plugins/destiny.pm b/xCAT-server-2.0/usr/lib/xcat/plugins/destiny.pm index d9c215a47..b550403a5 100644 --- a/xCAT-server-2.0/usr/lib/xcat/plugins/destiny.pm +++ b/xCAT-server-2.0/usr/lib/xcat/plugins/destiny.pm @@ -45,6 +45,7 @@ sub setdestiny { my $chaintab = xCAT::Table->new('chain'); my @nodes=@{$req->{node}}; my $state = $req->{arg}->[0]; + my %nstates; if ($state eq "next") { return nextdestiny(); } elsif ($state =~ /^install$/ or $state eq "install" or $state eq "netboot") { @@ -54,15 +55,16 @@ sub setdestiny { if ($errored) { return; } my $nodetype = xCAT::Table->new('nodetype'); foreach (@{$req->{node}}) { + $nstates{$_} = $state; #local copy of state variable for mod my $ntent = $nodetype->getNodeAttribs($_,[qw(os arch profile)]); if ($ntent and $ntent->{os}) { - $state .= " ".$ntent->{os}; + $nstates{$_} .= " ".$ntent->{os}; } if ($ntent and $ntent->{arch}) { - $state .= "-".$ntent->{arch}; + $nstates{$_} .= "-".$ntent->{arch}; } if ($ntent and $ntent->{profile}) { - $state .= "-".$ntent->{profile}; + $nstates{$_} .= "-".$ntent->{profile}; } unless ($state =~ /^netboot/) { $chaintab->setNodeAttribs($_,{currchain=>"boot"}); }; } @@ -105,7 +107,11 @@ sub setdestiny { return; } foreach (@nodes) { - $chaintab->setNodeAttribs($_,{currstate=>$state}); + my $lstate = $state; + if ($nstates{$_}) { + $lstate = $nstates{$_}; + } + $chaintab->setNodeAttribs($_,{currstate=>$lstate}); } return getdestiny(); }