From 8be6104a561c837f30baed84b87a24546fc10ce5 Mon Sep 17 00:00:00 2001 From: jjhua Date: Fri, 12 Oct 2012 07:15:19 +0000 Subject: [PATCH] To support site.precreatemypostscripts=1 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13995 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 5aca2de13..938685508 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -709,6 +709,7 @@ sub subvars_for_mypostscript { my $masterhash = getMasters($nodes); + ## nfsserver,installnic,primarynic my $attribsfromnoderes = getNoderes($nodes); @@ -740,8 +741,10 @@ sub subvars_for_mypostscript { $allattribsfromsitetable =~ s/MASTER=([^\n]+)\n/MASTER=$master\n/; } - # ENABLESSHBETWEENNODES + #get the node type, service node or compute node + my $nodetype = getNodeType($node); + ## nfsserver,installnic,primarynic my ($nfsserver, $installnic, $primarynic, $route_vars); @@ -866,6 +869,7 @@ sub subvars_for_mypostscript { $inc =~ s/#COMMAND:([^#]+)#/command($1)/eg; $inc =~ s/#NODE#/$node/eg; $inc =~ s/\$NODE/$node/eg; + $inc =~ s/#NTYPE#/$nodetype/eg; $inc =~ s/#NFSSERVER#/$nfsserver/eg; $inc =~ s/#INSTALLNIC#/$installnic/eg; $inc =~ s/#PRIMARYNIC#/$primarynic/eg; @@ -1072,6 +1076,29 @@ sub subroutine return $result; } + +sub getNodeType +{ + + my $node = shift; + my $result; + + # see if this is a service or compute node? + if (xCAT::Utils->isSN($node)) + { + $result="service"; + } + else + { + $result="compute"; + } + + return $result; +} + + + + sub getVlanItems {