From 9c9feda9093d116e78792738d45f985bb2a5cd96 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Wed, 5 May 2010 08:09:28 +0000 Subject: [PATCH] -defect 2992985 is fixed; git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5968 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/statelite.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index 36ae64051..89a09c0e2 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -336,17 +336,22 @@ sub liteMe { # if no such file like $rif, create one unless ( -e "$rif" ) { - my $rifstr = $rif; if($f =~ m{/$}) { $verbose && $callback->({info=>["mkdir -p $rif"]}); system("mkdir -p $rif"); } else { + # check whether its directory exists or not + my $rifdir = dirname($rif); + unless( -e $rifdir ) { + $verbose && $callback->({info => ["mkdir $rifdir"]}); + mkdir($rifdir); + } $verbose && $callback->({info=>["touch $rif"]}); system("touch $rif"); } } - if( !(-e "$rootimg_dir/.default$d") ) { + unless ( -e "$rootimg_dir/.default$d" ) { $verbose && $callback->({info=>["mkdir -p $rootimg_dir/.default$d"]}); system("mkdir -p $rootimg_dir/.default$d"); }