fixed bug 3230, support for the mn

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14652 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-12-14 07:14:01 +00:00
parent 0f91f3a5a9
commit a4f5515786

View File

@ -700,6 +700,7 @@ my $os;
my $profile;
my $arch;
my $provmethod;
my $mn;
%::GLOBAL_TAB_HASH = ();
%::GLOBAL_SN_HASH = ();
%::GLOBAL_TABDUMP_HASH = ();
@ -712,7 +713,7 @@ sub subvars_for_mypostscript {
#my $tmpl = shift; #tmplfile default: "/opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl" customized: /install/postscripts/mypostscript.tmpl
$tmplerr=undef; #clear tmplerr since we are starting fresh
my %namedargs = @_; #further expansion of this function will be named arguments, should have happened sooner.
my $installroot;
my @entries = xCAT::TableUtils->get_site_attribute("installdir");
if($entries[0]) {
@ -749,6 +750,8 @@ sub subvars_for_mypostscript {
return;
}
$mn = xCAT::Utils->noderangecontainsMn(@$nodes);
my $inc;
my $t_inc;
my %table;
@ -757,7 +760,7 @@ sub subvars_for_mypostscript {
#First load input into memory..
while (<$inh>) {
$t_inc.=$_;
#if( $_ =~ /#TABLE:([^:]+):([^:]+):([^#]+)#/ || $_ =~ /#TABLE:([^:]+):([^:]+):([^#]+):BLANKOKAY#/) {
if( $_ =~ /#TABLE:([^:]+):([^:]+):([^#]+)#/ ) {
my $tabname=$1;
my $key=$2;
@ -776,6 +779,8 @@ sub subvars_for_mypostscript {
close($inh);
##
# $Tabname_hash{$key}{$attrib}=value
# for example: $MAC_hash{cn001}{mac}=9a:ca:be:a9:ad:02
@ -842,7 +847,12 @@ sub subvars_for_mypostscript {
##attributes from site tab
#
#my $master = $attribsfromnoderes->{$node}->{xcatmaster};
my $master = $::GLOBAL_TAB_HASH{noderes}{$node}{xcatmaster};
my $master;
my $noderesent;
if( defined( $::GLOBAL_TAB_HASH{noderes}) && defined( $::GLOBAL_TAB_HASH{noderes}{$node}) ) {
$master = $::GLOBAL_TAB_HASH{noderes}{$node}{xcatmaster};
$noderesent = $::GLOBAL_TAB_HASH{noderes}{$node};
}
if( !defined($master) ) {
$::GLOBAL_TAB_HASH{noderes}{$node}{xcatmaster} = $::XCATSITEVALS{master};
@ -851,13 +861,6 @@ sub subvars_for_mypostscript {
#get the node type, service node or compute node
my $nodetype = getNodeType($node);
my $noderesent;
if(exists($::GLOBAL_TAB_HASH{noderes}{$node})) {
$noderesent = $::GLOBAL_TAB_HASH{noderes}{$node};
}
#print Dumper($noderesent);
#routes
my $route_vars;
@ -1086,7 +1089,11 @@ sub getNodeType
my $node = shift;
my $result;
if ( $node =~ /^$mn$/) {
$result="mn";
return $result;
}
# see if this is a service or compute node?
if ($::GLOBAL_SN_HASH{$node} == 1)
{