From 468644eee4cff438326f9e05c5f2bb54d74f6084 Mon Sep 17 00:00:00 2001 From: lissav Date: Sun, 26 Aug 2012 11:08:28 +0000 Subject: [PATCH] fix defect 3555748 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13611 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 20bde94bd..460f40056 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -803,24 +803,24 @@ sub updatenode { push @{$syncfile_node{$synclist}}, $node; } - } + } - # Check the existence of the synclist file - foreach my $synclist (keys %syncfile_node) - { + # Check the existence of the synclist file + foreach my $synclist (keys %syncfile_node) + { if (!(-r $synclist)) { my $rsp = {}; $rsp->{data}->[0] = - "The Synclist file $synclist which specified for certain node does NOT existed."; + "The Synclist file $synclist which was specified for the nodes does NOT existed."; xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } - } - - # Sync files to the target nodes - foreach my $synclist (keys %syncfile_node) - { + } + if (%syncfile_node) { # there are files to sync defined + #Sync files to the target nodes + foreach my $synclist (keys %syncfile_node) + { if ($::VERBOSE) { my $rsp = {}; @@ -851,10 +851,15 @@ sub updatenode }, $callback ); - } - my $rsp = {}; - $rsp->{data}->[0] = "File synchronization has completed."; - $callback->($rsp); + } + my $rsp = {}; + $rsp->{data}->[0] = "File synchronization has completed."; + $callback->($rsp); + } else { # no syncfiles defined + my $rsp = {}; + $rsp->{data}->[0] = "There were no syncfiles defined to process. File synchronization has completed."; + $callback->($rsp); + } } if (scalar(@$AIXnodes))