From 1175706f14ea6256b3b1c521f21b89c83fb4beb2 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 13 Apr 2011 13:59:10 +0000 Subject: [PATCH] Speed up noderange by using %::XCATSITEVALS hash instead of expensive DB calls git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9298 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 0f4110361..b36d5a5e3 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -583,19 +583,13 @@ sub noderange { if ($exsitenode) { my $badnoderange = 0; my @badnodes = (); - my $sitetab = xCAT::Table->new('site',-create=>0); - if ($sitetab) { - my ($ref) = $sitetab->getAttribs({key => 'excludenodes'}, 'value'); - if ($ref and $ref->{value}) { - $badnoderange = $ref->{value}; - # use the exsitenode argument to exit recursion - @badnodes = noderange($badnoderange, 1, 0); + if ($::XCATSITEVALS{excludenodes}) { + @badnodes = noderange($::XCATSITEVALS{excludenodes}, 1, 0); foreach my $bnode (@badnodes) { if (!$delnodes{$bnode}) { $delnodes{$bnode} = 1; } - } - } + } } }