From e61fa1f2c34c2c96b6b7d20b0692d96d532c1049 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 11 Jul 2008 14:12:05 +0000 Subject: [PATCH] -Speed up nodeset a small amount, still not hitting the lions share of the load yet git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1862 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/anaconda.pm | 40 ++++++++++++++---------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 52b6c454f..d8410bdd8 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -9,7 +9,7 @@ use xCAT::Utils; use xCAT::MsgUtils; use xCAT::Yum; use xCAT::Template; -use xCAT::Postage; +#use xCAT::Postage; use Data::Dumper; use Getopt::Long; Getopt::Long::Configure("bundling"); @@ -160,9 +160,10 @@ sub mknetboot } } my %donetftp=(); + my %oents = %{$ostab->getNodesAttribs(\@nodes,[qw(os arch profile)])}; foreach $node (@nodes) { - my $ent = $ostab->getNodeAttribs($node, ['os', 'arch', 'profile']); + my $ent = $oents{$node}->[0]; #ostab->getNodeAttribs($node, ['os', 'arch', 'profile']); unless ($ent->{os} and $ent->{arch} and $ent->{profile}) { $callback->( @@ -364,10 +365,20 @@ sub mkinstall my $node; my $ostab = xCAT::Table->new('nodetype'); my %doneimgs; + my $restab = xCAT::Table->new('noderes'); + my $bptab = xCAT::Table->new('bootparams',-create=>1); + my $hmtab = xCAT::Table->new('nodehm'); + my %osents = %{$ostab->getNodesAttribs(\@nodes, ['profile', 'os', 'arch'])}; + my %rents = + %{$restab->getNodesAttribs(\@nodes, + ['nfsserver', 'primarynic', 'installnic'])}; + my %hents = + %{$hmtab->getNodesAttribs(\@nodes, + ['serialport', 'serialspeed', 'serialflow'])}; foreach $node (@nodes) { my $osinst; - my $ent = $ostab->getNodeAttribs($node, ['profile', 'os', 'arch']); + my $ent = $osents{$node}->[0]; #$ostab->getNodeAttribs($node, ['profile', 'os', 'arch']); my @missingparms; unless ($ent->{os}) { push @missingparms,"nodetype.os"; @@ -565,19 +576,16 @@ sub mkinstall } #We have a shot... - my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams',-create=>1); - my $hmtab = xCAT::Table->new('nodehm'); - my $ent = - $restab->getNodeAttribs($node, - ['nfsserver', 'primarynic', 'installnic']); - my $sent = - $hmtab->getNodeAttribs( - $node, - [ - 'serialport', 'serialspeed', 'serialflow' - ] - ); + my $ent = $rents{$node}->[0]; +# $restab->getNodeAttribs($node, +# ['nfsserver', 'primarynic', 'installnic']); + my $sent = $hents{$node}->[0]; +# $hmtab->getNodeAttribs( +# $node, +# [ +# 'serialport', 'serialspeed', 'serialflow' +# ] +# ); unless ($ent and $ent->{nfsserver}) { $callback->(