From c84b39852c73363e635cf6485c51de4213dcd74e Mon Sep 17 00:00:00 2001 From: vallard Date: Fri, 21 May 2010 06:44:28 +0000 Subject: [PATCH] added fix to allow esx in imgport git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6192 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/imgport.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/imgport.pm b/xCAT-server/lib/xcat/plugins/imgport.pm index 3bbd77abb..e049c7e52 100644 --- a/xCAT-server/lib/xcat/plugins/imgport.pm +++ b/xCAT-server/lib/xcat/plugins/imgport.pm @@ -96,7 +96,7 @@ sub ximport { GetOptions( 'h|?|help' => \$help, - 'v|verbose' => \$::VERBOSE + 'v|verbose' => \$::VERBOSE, ); if($help){ @@ -123,7 +123,7 @@ sub xexport { my $xusage = sub { my $ec = shift; push@{ $rsp{data} }, "imgexport: Creates a tarball of an existing xCAT image"; - push@{ $rsp{data} }, "Usage: imgexport [directory] [[--extra ] ... ]"; + push@{ $rsp{data} }, "Usage: imgexport [-f] [directory] [[--extra ] ... ]"; if($ec){ $rsp{errorcode} = $ec; } $callback->(\%rsp); }; @@ -285,6 +285,7 @@ sub get_files{ } my $provmethod = $attrs->{provmethod}; + my $osvers = $attrs->{osvers}; # here's the case for the install. All we need at first is the # template. That should do it. @@ -307,7 +308,9 @@ sub get_files{ # ramdisk # the kernel # the rootimg.gz - if($provmethod =~ /netboot/){ + if($osvers =~ /esx/){ + # don't do anything because these files don't exist for ESX stateless. + }elsif($provmethod =~ /netboot/){ @arr = ("$installroot/netboot"); # look for ramdisk @@ -681,6 +684,10 @@ sub verify_manifest { } #$attrs->{media} = "required"; (need to do something to verify media! + }elsif($data->{osvers} =~ /esx/){ + $callback->({info => ['this is an esx image']}); + # do nothing for ESX + 1; }elsif($data->{provmethod} =~ /netboot|statelite/){ unless($data->{ramdisk}){ $callback->({error=>["The 'ramdisk' field is not defined in manifest.xml."],errorcode=>[1]}); @@ -745,6 +752,8 @@ sub make_files { } move("$imgdir/$template", $instdir); + }elsif($data->{osvers} =~ /esx/){ + 1; }elsif($data->{provmethod} =~/netboot|statelite/){ # data will look something like this: