From fe38638b4b4820afbe48bb2c85e3e48261990863 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 21 Mar 2014 10:56:20 -0400 Subject: [PATCH] Support 'specific' copycds mode. ESXi releases updates without bumping version numbers. For such cases, the default behavior is for the new version to supersede the old. This makes sense for the vast majority of cases. There are, however, corner cases where being explicit about the release is indicated. --- xCAT-server/lib/xcat/plugins/copycds.pm | 6 +++++ xCAT-server/lib/xcat/plugins/esx.pm | 32 ++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index fa6062d09..92177972d 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -43,6 +43,7 @@ sub process_request { my $path=undef; my $noosimage=undef; my $nonoverwrite=undef; + my $specific=undef; $identified=0; $::CDMOUNTPATH="/var/run/xcat/mountpoint"; @@ -58,6 +59,7 @@ sub process_request { 'i|inspection' => \$inspection, 'p|path=s' => \$path, 'o|noosimage' => \$noosimage, + 's|specific' => \$specific, 'w|nonoverwrite' => \$nonoverwrite, ); if ($help) { @@ -143,6 +145,10 @@ sub process_request { { push @{$newreq->{arg}},("-p",$path); } + if($specific) + { + push @{$newreq->{arg}},("-s"); + } if($inspection) { diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 90384d9db..fcc28f2f8 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -4141,10 +4141,12 @@ sub copycd { } #} @ARGV = @{$request->{arg}}; + my $includeupdate = 0; GetOptions( 'n=s' => \$distname, 'a=s' => \$arch, - 'm=s' => \$path + 'm=s' => \$path, + 's' => \$includeupdate ); # run a few tests to see if the copycds should use this plugin unless ($path){ @@ -4236,6 +4238,34 @@ sub copycd { } } close(LINE); + } elsif (-r $path . "/upgrade/metadata.xml") { + open(LINE,$path."/upgrade/metadata.xml"); + my $detectdistname; + while () { + if (/esxVersion>([^<]*)([^<]*)) {