diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 79368d157..e89a807d7 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -147,6 +147,13 @@ sub subvars { $inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg; } } + + #Support hierarchical include + $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; + if ($inc =~ /#INCLUDE:[^#^\n]+#/) { + $inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg; + } + #ok, now do everything else.. $inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg; $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;