From f01e654001ac15ae297187f6ee3a4f9ec7e39052 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 12 May 2012 11:50:36 +0000 Subject: [PATCH] Fix problem where nodegroup enumerated groups could last forever, also eliminate calls to retain_cache with (0) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12647 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index c82bea962..913fc3a65 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -32,10 +32,11 @@ my $grptab; #my $nodeprefix = "node"; my @allnodeset; -my $allnodesetstamp; +my $allnodesetstamp=0; my %allnodehash; my @grplist; my $didgrouplist; +my $glstamp=0; my %allgrphash; my $allgrphashstamp; my $retaincache=0; @@ -210,8 +211,9 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels unless ($grptab) { $grptab = xCAT::Table->new('nodegroup'); } - if ($grptab and not $didgrouplist and not scalar @grplist) { + if ($grptab and (($glstamp < (time()-5)) or (not $didgrouplist and not scalar @grplist))) { $didgrouplist = 1; + $glstamp=time(); @grplist = @{$grptab->getAllEntries()}; } my $isdynamicgrp = 0; @@ -478,7 +480,6 @@ sub extnoderange { #An extended noderange function. Needed as the more straight } $return->{intersectinggroups}=[sort keys %grouphash]; } - retain_cache(0); return $return; } sub abbreviate_noderange { @@ -626,10 +627,6 @@ sub noderange { } if ($recurselevel) { $recurselevel--; - } else { - #unless ($retaincache) { - # retain_cache(0); - #} } return sort (keys %nodes);