From 48d5b1759db3d0af7e3d137921628ee882bed43d Mon Sep 17 00:00:00 2001 From: yinle Date: Mon, 5 Dec 2011 09:12:15 +0000 Subject: [PATCH] Fix bug 3451003:xcatsetup can't work with some kinds of host-name git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11124 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/setup.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index 7278107f4..a217ab4fe 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -1156,9 +1156,11 @@ sub writelpar { #my $cecsperbb = $STANZAS{'xcat-building-blocks'}->{'num-cecs-per-bb'}; #if ($cecsperbb !~ /^\d+$/) { errormsg("invalid non-integer value for num-cecs-per-bb: $cecsperbb", 7); return 0; } for (my $b=1; $b<=$numbbs; $b++) { - my $framebase = ($b-1) * $framesperbb + 1; - findSNsinBB('service', $b, $framebase, $rangeparts, \%servicenodes, \%lpars) or return 0; - findSNsinBB('storage', $b, $framebase, $rangeparts, \%storagenodes) or return 0; + #my $framebase = ($b-1) * $framesperbb + 1; + #findSNsinBB('service', $b, $framebase, $rangeparts, \%servicenodes, \%lpars) or return 0; + #findSNsinBB('storage', $b, $framebase, $rangeparts, \%storagenodes) or return 0; + findSNsinBB('service', $b, $rangeparts, \%servicenodes, \%lpars) or return 0; + findSNsinBB('storage', $b, $rangeparts, \%storagenodes) or return 0; } if (scalar(keys(%servicenodes))) { $tables{'nodelist'}->setNodesAttribs(\%servicenodes); @@ -1181,7 +1183,8 @@ sub writelpar { # Find either service nodes or storage nodes in a BB. Adds the nodenames of the lpars to the snodes hash, # and defines the groups in the hash, and assigns the other lpars to the correct service node. sub findSNsinBB { - my ($sntext, $bb, $framebase, $rangeparts, $snodes, $lpars) = @_; + #my ($sntext, $bb, $framebase, $rangeparts, $snodes, $lpars) = @_; + my ($sntext, $bb, $rangeparts, $snodes, $lpars) = @_; my $primbase = $$rangeparts{'primary-base'}; my $primlen = length($$rangeparts{'primary-start'}); my $secbase = $$rangeparts{'secondary-base'}; @@ -1197,6 +1200,9 @@ sub findSNsinBB { if (scalar(@snpositions) != $snsperbb) { errormsg("invalid number of positions specified for xcat-$sntext-nodes:cec-positions-in-bb.", 3); return 0; } my $cecsperframe = $STANZAS{'xcat-cecs'}->{'num-cecs-per-frame'}; # they may have specified this instead of a supernode-list, which would fill in NUMCECSINFRAME my @snsinbb; + my $framerange = $STANZAS{'xcat-frames'}->{'hostname-range'}; + my $framename = parsenoderange($framerange); + my $framebase = $$framename{'primary-start'}; foreach my $p (@snpositions) { my $cecbase = 0; my $frame = $framebase;