From 8fe6b85410abfa6af2fcfc38b153fcb5e9b115ef Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 10 Oct 2009 14:50:06 +0000 Subject: [PATCH] -Fix for bug 2873054 -Request to noderange to stop actively preserving cache now also has noderange to actively drop any current cache git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4341 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 6 ++++++ perl-xCAT/xCAT/Table.pm | 2 ++ 2 files changed, 8 insertions(+) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 334d6f724..a4c1a75b7 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -397,6 +397,12 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels sub retain_cache { #A semi private operation to be used *ONLY* in the interesting Table<->NodeRange module interactions. $retaincache=shift; + unless ($retaincache) { #take a call to retain_cache(0) to also mean that any existing + #cache must be zapped + if ($nodelist) { $nodelist->_clear_cache(); } + undef $nodelist; + @allnodeset=(); + } } sub extnoderange { #An extended noderange function. Needed as the more straightforward function return format too simple for this. my $range = shift; diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 453e174f9..68858ea89 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -1949,6 +1949,8 @@ sub getAllNodeAttribs xCAT::NodeRange::retain_cache(1); $self->{_use_cache} = 0; $self->{nodelist}->{_use_cache}=0; + $self->_clear_cache(); + $self->{nodelist}->_clear_cache(); $self->_build_cache($attribq); $self->{nodelist}->_build_cache(['node','groups']); $self->{_use_cache} = 1;