From 8b4a5fdb233da656baedf4037a6e12f0fa076c85 Mon Sep 17 00:00:00 2001 From: cjhardee Date: Wed, 10 Nov 2010 16:21:58 +0000 Subject: [PATCH] Creates the 'override' directory in cpNetbootImages if it doesn't already exist. This will be the default directory unless the user specifies a different osver value. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8118 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 4e1ec6c6c..a96074473 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -3914,20 +3914,24 @@ sub cpNetbootImages { } } - if (-d $overridedir) { #Copy over all modules - use File::Basename; - foreach (glob "$overridedir/*") { - my $mod = scalar fileparse($_); - if ($mod =~ /gz\z/ and $mod !~ /pkgdb.tgz/ and $mod !~ /vmkernel.gz/) { - $modulestoadd->{$mod}=1; - copy($_,"$destDir/$mod") or xCAT::SvrUtils::sendmsg([1,"Could not copy netboot contents from $overridedir to $destDir"], $output_handler); - } elsif ($mod =~ /vmkernel.gz/) { - $modulestoadd->{"vmk.gz"}=1; - copy($_,"$destDir/vmk.gz") or xCAT::SvrUtils::sendmsg([1,"Could not copy netboot contents from $overridedir to $destDir"], $output_handler); - } - } + + #this is the override directory if there is one, otherwise it's actually the default dir + if (-d $overridedir) { + mkdir($overridedir); } + #Copy over all modules + use File::Basename; + foreach (glob "$overridedir/*") { + my $mod = scalar fileparse($_); + if ($mod =~ /gz\z/ and $mod !~ /pkgdb.tgz/ and $mod !~ /vmkernel.gz/) { + $modulestoadd->{$mod}=1; + copy($_,"$destDir/$mod") or xCAT::SvrUtils::sendmsg([1,"Could not copy netboot contents from $overridedir to $destDir"], $output_handler); + } elsif ($mod =~ /vmkernel.gz/) { + $modulestoadd->{"vmk.gz"}=1; + copy($_,"$destDir/vmk.gz") or xCAT::SvrUtils::sendmsg([1,"Could not copy netboot contents from $overridedir to $destDir"], $output_handler); + } + } }else{ xCAT::SvrUtils::sendmsg([1,"VMware $osver is not supported for netboot"], $output_handler);