From f688e3f09f7169f433f2f2630f7d776590e49655 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 10 Aug 2009 21:09:00 +0000 Subject: [PATCH] -Fix BUG on empty criteria searches -Accept '=' as a delimeter for convenience (NodeRange will never support assignment of table values, it makes no sense) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3981 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index d1fece21a..7ae3c5117 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -76,6 +76,9 @@ sub nodesbycriteria { } elsif ($criteria =~ /[^=]*==/) { ($criteria,$value) = split /==/,$criteria,2; $matchtype='match'; + } elsif ($criteria =~ /[^=]*=/) { + ($criteria,$value) = split /=/,$criteria,2; + $matchtype='match'; } elsif ($criteria =~ /[^=]*!~/) { ($criteria,$value) = split /!~/,$criteria,2; $value =~ s/^\///; @@ -208,7 +211,11 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels foreach (@allnodeset) { push @nodes,$_->{node}; } - return @{nodesbycriteria(\@nodes,[$atom])->{$atom}}; + my $nbyc = nodesbycriteria(\@nodes,[$atom])->{$atom}; + if (defined $nbyc) { + return @$nbyc; + } + return (); } if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix my $nodename=$nprefix.$atom.$nsuffix;