From d183a0bb9d67e5762dddc46e4a9d1d430984ac9b 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 655556ee5..d502071a9 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -4333,10 +4333,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){ @@ -4428,6 +4430,34 @@ sub copycd { } } close(LINE); + } elsif (-r $path . "/upgrade/metadata.xml") { + open(LINE,$path."/upgrade/metadata.xml"); + my $detectdistname; + while () { + if (/esxVersion>([^<]*)([^<]*)) {