From 22d82e9a5d4277dd602b3aa0701b061cec5cc58c Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 24 Aug 2009 09:53:55 +0000 Subject: [PATCH] defect 2843392: if there is non-existed synclist file, output an error message git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4031 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 6 +----- xCAT-server/lib/xcat/plugins/updatenode.pm | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 5fa55e53b..fd8d81f33 100644 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -249,11 +249,7 @@ sub getsynclistfile() } foreach my $osimage (@profiles) { my $synclist = $osimage_t->getAttribs({imagename=>"$osimage"}, 'synclists'); - if (-r $synclist->{'synclists'}) { - $osimage_syncfile{$osimage} = $synclist->{'synclists'}; - } else { - $osimage_syncfile{$osimage} = undef; - } + $osimage_syncfile{$osimage} = $synclist->{'synclists'}; } # set the syncfiles to the nodes diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 0a510855d..94b595125 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -306,6 +306,16 @@ sub updatenode { } } + # 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."; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + } + # Sync files to the target nodes foreach my $synclist (keys %syncfile_node) { my $args = ["-F", "$synclist"];