From ab5a84d3952ecf228d4595587afb7dd19ed97081 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 Oct 2015 15:16:56 -0400 Subject: [PATCH] Fix mix of invalid token and grouped nodes When a parenthetical group occurred after an invalid token, it failed to report the error. Address this problem. --- perl-xCAT/xCAT/NodeRange.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 8abfa9ff1..a28b67e2a 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -578,13 +578,15 @@ sub set_arith { # - exsitenode: whether or not to honor site.excludenodes to automatically exclude those nodes from all noderanges # - options: genericrange - a purely syntactical expansion of the range, not using the db at all, e.g not expanding group names sub noderange { - $missingnodes=[]; #We for now just do left to right operations my $range=shift; $range =~ s/['"]//g; my $verify = (scalar(@_) >= 1 ? shift : 1); my $exsitenode = (scalar(@_) >= 1 ? shift : 1); # if 1, honor site.excludenodes my %options = @_; # additional options + unless ($options{keepmissing}) { + $missingnodes=[]; + } unless ($nodelist) { $nodelist =xCAT::Table->new('nodelist',-create =>1); @@ -609,8 +611,8 @@ sub noderange { $start =~ s/,-$//; $start =~ s/,$//; $start =~ s/\@$//; - %nodes = map { $_ => 1 } noderange($start,$verify,$exsitenode,%options); - my %innernodes = map { $_ => 1 } noderange($middle,$verify,$exsitenode,%options); + %nodes = map { $_ => 1 } noderange($start,$verify,$exsitenode,%options,keepmissing=>1); + my %innernodes = map { $_ => 1 } noderange($middle,$verify,$exsitenode,%options,keepmissing=>1); set_arith(\%nodes,$op,\%innernodes); $range = $end; }