From 61faf24e928b1950a119ef45a1dc941b30247542 Mon Sep 17 00:00:00 2001 From: cridye Date: Thu, 19 Nov 2009 22:46:26 +0000 Subject: [PATCH] fixes for esx plugin mknetboot git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4624 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index db2f38560..56e17044b 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -14,7 +14,7 @@ use POSIX "WNOHANG"; use Getopt::Long; use Thread qw(yield); use POSIX qw(WNOHANG nice); -use File::Path; +use File::Path qw/mkpath rmtree/; use File::Temp qw/tempdir/; use File::Copy; use IO::Socket; #Need name resolution @@ -2044,6 +2044,9 @@ sub mknetboot { my %nodesubdata; foreach my $key (keys %$bpadds){ #First, we identify all needed table.columns needed to aggregate database call my $add = $bpadds->{$key}->[0]->{addkcmdline}; + + next if ! defined $add; + while ($add =~ /#NODEATTRIB:([^:#]+):([^:#]+)#/) { push @{$tablecolumnsneededforaddkcmdline{$1}},$2; $add =~ s/#NODEATTRIB:([^:#]+):([^:#]+)#//; @@ -2201,6 +2204,11 @@ sub cpNetbootImages { sendmsg([1,"unable to mount partition 5 of the ESX netboot image to /mnt/xcat"]); return; } + + if (! -d $destDir) { + print "making $destDir\n"; + mkpath($destDir); + } if(system("cp /mnt/xcat/* $destDir/")){ sendmsg([1,"Could not copy netboot contents to $destDir"]);