From a312ff54c16c4e122b877b99599769a5e995d99a Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 30 Sep 2011 18:07:03 +0000 Subject: [PATCH] Fix legacy boot breakage by windows uefi support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10684 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 12 ++++++++++++ xCAT-server/lib/xcat/plugins/windows.pm | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index a3446f533..9b5a175c6 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -21,6 +21,7 @@ my $field; my $idir; my $node; my %loggedrealms; +my $lastmachinepass; sub subvars { my $self = shift; @@ -31,6 +32,10 @@ sub subvars { my $pkglistfile=shift; my $media_dir = shift; my $platform=shift; + my %namedargs = @_; #further expansion of this function will be named arguments, should have happened sooner. + unless ($namedargs{reusemachinepass}) { + $lastmachinepass=""; + } my $outh; my $inh; @@ -162,6 +167,12 @@ sub subvars { return 0; } sub machinepassword { + if ($lastmachinepass) { #note, this should only happen after another call + #to subvars that does *not* request reuse + #the issue being avoiding reuse in the installmonitor case + #subvars function clears this if appropriate + return $lastmachinepass; + } my $domaintab = xCAT::Table->new('domain'); $ENV{HOME}='/etc/xcat'; $ENV{LDAPRC}='ad.ldaprc'; @@ -231,6 +242,7 @@ sub machinepassword { if ($data->{error}) { return "ERROR: ".$data->{error}; } else { + $lastmachinepass=$data->{password}; return $data->{password}; } } diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index 5520e6142..c12fa194a 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -336,7 +336,7 @@ sub mkinstall $tmplfile.".uefi", "$installroot/autoinst/$node.uefi", $node, - 0 + 0, undef,undef,reusemachinepass=>1, ); }