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"];