From cadca639d80fcb0357ed7b887cf7e86923a293ed Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Thu, 30 May 2013 09:24:24 +0000 Subject: [PATCH] fixed the problem that xcat failed to replace some system environments if there are mulitple levels of #INCLUDE. we should firstly expand the #INCLUDE and then to replace the system environements git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16476 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index b3d34af0c..6c2356d57 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -208,20 +208,20 @@ sub subvars { } #ok, now do everything else.. - $inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg; - $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; - $inc =~ s/#MACHINEPASSWORD#/machinepassword()/eg; $inc =~ s/#TABLE:([^:]+):([^:]+):([^#]+)#/tabdb($1,$2,$3)/eg; $inc =~ s/#TABLEBLANKOKAY:([^:]+):([^:]+):([^#]+)#/tabdb($1,$2,$3,'1')/eg; - $inc =~ s/#CRYPT:([^:]+):([^:]+):([^#]+)#/crydb($1,$2,$3)/eg; - $inc =~ s/#COMMAND:([^#]+)#/command($1)/eg; - $inc =~ s/#KICKSTARTNET#/kickstartnetwork()/eg; - $inc =~ s/#ESXIPV6SETUP#/esxipv6setup()/eg; $inc =~ s/#INCLUDE_NOP:([^#^\n]+)#/includefile($1,1,0)/eg; $inc =~ s/#INCLUDE_PKGLIST:([^#^\n]+)#/includefile($1,0,1)/eg; $inc =~ s/#INCLUDE_PTRNLIST:([^#^\n]+)#/includefile($1,0,2)/eg; $inc =~ s/#INCLUDE_RMPKGLIST:([^#^\n]+)#/includefile($1,0,3)/eg; $inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg; + $inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg; + $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; + $inc =~ s/#MACHINEPASSWORD#/machinepassword()/eg; + $inc =~ s/#CRYPT:([^:]+):([^:]+):([^#]+)#/crydb($1,$2,$3)/eg; + $inc =~ s/#COMMAND:([^#]+)#/command($1)/eg; + $inc =~ s/#KICKSTARTNET#/kickstartnetwork()/eg; + $inc =~ s/#ESXIPV6SETUP#/esxipv6setup()/eg; $inc =~ s/#WINTIMEZONE#/xCAT::TZUtils::get_wintimezone()/eg; $inc =~ s/#WINPRODKEY:([^#]+)#/get_win_prodkey($1)/eg; $inc =~ s/#WINNETCFG#/windows_net_cfg()/eg;