From 212e4ef603c4296a86a0c249918954147af933b9 Mon Sep 17 00:00:00 2001 From: qyin Date: Thu, 22 May 2014 15:57:44 +0800 Subject: [PATCH] driver patch code submit --- Version | 1 - xCAT-server/lib/xcat/plugins/00kitnodebase.pm | 15 ++++++++++++++- xCAT-server/lib/xcat/plugins/destiny.pm | 18 +++++++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) delete mode 100644 Version diff --git a/Version b/Version deleted file mode 100644 index 2701a226a..000000000 --- a/Version +++ /dev/null @@ -1 +0,0 @@ -2.8.4 diff --git a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm index ea985c236..b118c4720 100644 --- a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm +++ b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm @@ -92,6 +92,7 @@ sub process_request { my @commandslist; my %argslist; + my $noupdate_flag = 0; my %msghash = ( "makehosts" => "Updating hosts entries", "makedns" => "Updating DNS entries", "makedhcp" => "Update DHCP entries", @@ -143,6 +144,10 @@ sub process_request { if($macflag) { if ($chainarray[0]){ + if($chainarray[0] =~ m/^osimage=/) + { + $noupdate_flag = 1; + } push @commandslist, ['nodeset', $chainarray[0]]; } } @@ -161,6 +166,7 @@ sub process_request { my $firstnode = (@$nodelist)[0]; if (exists $profilehash{$firstnode}{"ImageProfile"}){ my $osimage = 'osimage='.$profilehash{$firstnode}{"ImageProfile"}; + $noupdate_flag = 1; push @commandslist, ['nodeset', $osimage]; } } @@ -170,7 +176,14 @@ sub process_request { my $current_cmd = $_->[0]; my $current_args = $_->[1]; setrsp_progress($msghash{$current_cmd}); - my $retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, 0, 2); + if(($current_cmd eq "nodeset") && $noupdate_flag) + { + $retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args, "--noupdateinitrd"]}, $request_command, 0, 2); + } + else + { + $retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, 0, 2); + } log_cmd_return($retref); } diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 983598deb..fed153414 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -571,6 +571,7 @@ sub nextdestiny { } my $node; + my $noupdate_flag = 0; $chaintab = xCAT::Table->new('chain'); my $chainents = $chaintab->getNodesAttribs(\@nodes,[qw(currstate currchain chain)]); foreach $node (@nodes) { @@ -598,13 +599,28 @@ sub nextdestiny { my %requ; $requ{node}=[$node]; $requ{arg}=[$ref->{currstate}]; + if($ref->{currstate} =~ /noupdateinitrd$/) + { + my @items = split /[:]/,$ref->{currstate}; + $requ{arg}= \@items; + $noupdate_flag = 1; + } setdestiny(\%requ, $flag+1); } if ($callnodeset) { + $args; + if($noupdate_flag) + { + $args = ['enact', '--noupdateinitrd']; + } + else + { + $args = ['enact']; + } $subreq->({command=>['nodeset'], node=> \@nodes, - arg=>['enact']}); + arg=>$args}); } }