From bf9929222aaef898e5733e91933333f9fcb0408a Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 15 Nov 2012 18:25:01 +0000 Subject: [PATCH] Move updatestatus to the last processing git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14341 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 39 ++++++++++++---------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 527ed76a2..0e8ea61be 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -888,7 +888,8 @@ sub updatenode my $request = shift; my $callback = shift; my $subreq = shift; - + @::SUCCESSFULLNODES=(); + @::FAILEDNODES=(); #print Dumper($request); my $nodes = $request->{node}; my $localhostname = hostname(); @@ -1134,6 +1135,21 @@ sub updatenode # } #} + # update the node status, this is done when -F -S -P are run + if(@::SUCCESSFULLNODES) + { + + my $stat="synced"; + xCAT::TableUtils->setUpdateStatus(\@::SUCCESSFULLNODES, $stat); + + } + if(@::FAILEDNODES) + { + + my $stat="out-of-sync"; + xCAT::TableUtils->setUpdateStatus(\@::FAILEDNODES, $stat); + + } return 0; } @@ -1312,9 +1328,10 @@ sub updatenoderunps else { my $rsp = {}; + my $output; while () { - my $output = $_; + $output = $_; chomp($output); $output =~ s/\\cM//; if ($output =~ /returned from postscript/) @@ -1343,6 +1360,9 @@ sub updatenoderunps } } close(CMD); + # # build the list of good and bad nodes + # &buildnodestatus(\@$output,$callback); + # return information $callback->($rsp); } } @@ -1465,21 +1485,6 @@ sub updatenodesyncfiles # build the list of good and bad nodes &buildnodestatus(\@$output,$callback); } - #set the nodelist.updatestatus according to the xdcp result - if(@::SUCCESSFULLNODES) - { - - my $stat="synced"; - xCAT::TableUtils->setUpdateStatus(\@::SUCCESSFULLNODES, $stat); - - } - if(@::FAILEDNODES) - { - - my $stat="out-of-sync"; - xCAT::TableUtils->setUpdateStatus(\@::FAILEDNODES, $stat); - - } my $rsp = {}; $rsp->{data}->[0] = "File synchronization has completed.";