From 6e235884d9cffca40258363a806e9988359c0065 Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 26 May 2011 18:00:23 +0000 Subject: [PATCH] merge the prescript changes made in r9606 to 2.6 branch git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@9696 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 48 +++++++++++++++++++--- xCAT-server/lib/xcat/plugins/pxe.pm | 16 +++++++- xCAT-server/lib/xcat/plugins/vsmppxe.pm | 16 +++++++- xCAT-server/lib/xcat/plugins/xnba.pm | 16 +++++++- xCAT-server/lib/xcat/plugins/yaboot.pm | 16 +++++++- 5 files changed, 98 insertions(+), 14 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index 9c22b1b09..dc47a579e 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -638,7 +638,13 @@ sub nimnodeset $subreq->({command=>['runbeginpre'], node=>\@nodelist, arg=>["standalone", '-l']},\&pass_along); - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts.\n"; + $callback->($rsp); + return 1; + } # @@ -1125,7 +1131,13 @@ sub nimnodeset node=>\@nodelist, arg=>["standalone", '-l']},\&pass_along); } - if ($errored) { $retcode = 1; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts.\n"; + $callback->($rsp); + return 1; + } return $retcode; } @@ -7807,7 +7819,13 @@ sub mkdsklsnode $subreq->({command=>['runbeginpre'], node=>\@nodelist, arg=>["diskless", '-l']},\&pass_along); - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts.\n"; + $callback->($rsp); + return 1; + } # @@ -8674,7 +8692,13 @@ sub mkdsklsnode node=>\@nodelist, arg=>["diskless", '-l']},\&pass_along); } - if ($errored) { $retcode = 1; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts.\n"; + $callback->($rsp); + return 1; + } return $retcode; @@ -9741,7 +9765,13 @@ sub rmdsklsnode # to handles my own children $errored=0; $subreq->({command=>['runbeginpre'], node=>\@nodelist, arg=>["remove", '-l']},\&pass_along); - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts.\n"; + $callback->($rsp); + return 1; + } # for each node my @nodesfailed; @@ -9916,7 +9946,13 @@ sub rmdsklsnode node=>\@nodelist, arg=>["remove", '-l']},\&pass_along); } - if ($errored) { $retcode = 1; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts.\n"; + $callback->($rsp); + return 1; + } return $retcode; diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 01fad97f5..a776b2a51 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -412,7 +412,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts\n"; + $callback->($rsp); + return; + } } #end prescripts code @@ -552,7 +558,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts\n"; + $callback->($rsp); + return; + } } diff --git a/xCAT-server/lib/xcat/plugins/vsmppxe.pm b/xCAT-server/lib/xcat/plugins/vsmppxe.pm index eff512d3a..f23eadb6f 100644 --- a/xCAT-server/lib/xcat/plugins/vsmppxe.pm +++ b/xCAT-server/lib/xcat/plugins/vsmppxe.pm @@ -309,7 +309,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts\n"; + $callback->($rsp); + return; + } } #end prescripts code @@ -418,7 +424,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts\n"; + $callback->($rsp); + return; + } } } diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index e5e0f0cb1..85338cb98 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -453,7 +453,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts.\n"; + $callback->($rsp); + return; + } } #back to normal business @@ -551,7 +557,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts.\n"; + $callback->($rsp); + return; + } } } diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 56d1aa177..2af9eb25e 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -345,7 +345,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running begin prescripts.\n"; + $callback->($rsp); + return; + } } #back to normal business @@ -434,7 +440,13 @@ sub process_request { node=>\@rnodes, arg=>[$args[0]]},\&pass_along); } - if ($errored) { return; } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0]=1; + $rsp->{error}->[0]="Failed in running end prescripts\n"; + $callback->($rsp); + return; + } } }