From 9d2e5f56085f84aa3c28f9b8c3023259241590c2 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Tue, 30 Nov 2010 09:25:14 +0000 Subject: [PATCH] Merge branch 'statelite' git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8286 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/statelite.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index 616b80d2a..599bedab3 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -213,6 +213,19 @@ sub process_request { my $listNew = $synclist[0]; + # the directory/file in litefile table must be the absolute path ("/***") + foreach my $entry (@$listNew) { + my @tmp = split (/\s+/, $entry); + unless ($tmp[2] =~ m{^/}) { + $callback->({error=>[qq{ $tmp[2] is not one absolute path. }], errorcode=>[1]}); + return; + } + if ($tmp[1] =~ m{con} and $tmp[2] =~ m{/$}) { + $callback->({error=>[qq{ $tmp[2] is directory, don't use "con" as its option }], errorcode=>[1]}); + return; + } + } + my %hashNew = (); if ( parseLiteFiles($listNew, \%hashNew) ) { $callback->({error=>["parseLiteFiles failed for listNew!"]}); @@ -224,6 +237,7 @@ sub process_request { foreach my $entry (keys %hashNew) { my @tmp = split (/\s+/, $entry); my $f = $tmp[1]; + if ($hashNew{$entry}) { if ( $tmp[0] =~ m/ro$/ or $tmp[0] =~ m/con$/) { $callback->({error=>[qq{the directory "$f" should not be with "ro" or "con" as its option}], errorcode=>[1]});