From dad755c5217fc332d39e78afe2c1e7d0183a354d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 2 Mar 2012 23:59:39 +0000 Subject: [PATCH] Have NodeRange.pm not flip out in the face of excessive quotes. Also, just in case, bail out after 4,096 recursions, just in case something else tortuous is being missed. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11731 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index dd17c1dfe..eb9ee8f1e 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -179,6 +179,7 @@ sub nodesbycriteria { sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels5.3) my $atom = shift; + if ($recurselevel > 4096) { die "NodeRange seems to be hung on evaluating $atom, recursion limit hit"; } unless (scalar(@allnodeset)) { #Build a cache of all nodes, some corner cases will perform worse, but by and large it will do better. We could do tests to see where the breaking points are, and predict how many atoms we have to evaluate to mitigate, for now, implement the strategy that keeps performance from going completely off the rails @allnodeset = $nodelist->getAllAttribs('node','groups'); %allnodehash = map { $_->{node} => 1 } @allnodeset; @@ -526,6 +527,7 @@ sub noderange { $missingnodes=[]; #We for now just do left to right operations my $range=shift; + $range =~ s/['"]//g; my $verify = (scalar(@_) >= 1 ? shift : 1); #excludenodes attribute in site table,